]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r322798: newvers.sh: accommodate `git worktree`
authoremaste <emaste@FreeBSD.org>
Tue, 5 Sep 2017 00:46:50 +0000 (00:46 +0000)
committeremaste <emaste@FreeBSD.org>
Tue, 5 Sep 2017 00:46:50 +0000 (00:46 +0000)
commitf0cd96c0753b2b62587703b804d707683ab65be2
treed16bc43928a8f707f5d8c43a48ea4ae367a3ad16
parent3a0a02f91804b30d13d9542bc812827e5a31a7c1
MFC r322798: newvers.sh: accommodate `git worktree`

newvers.sh looks for a .vcs subdirectory (e.g. .git, .svn) to determine
which vcs info tool to run (e.g., git rev-parse, svn info).

(As of r308789 in head / r323167 in stable/11 if a .vcs subdirectory is
not found at ${TOPDIR} then newvers.sh walks up successive parent
directories, testing for the .vcs subdirectory at each step.  This is
done in case the FreeBSD source is built in a subdirectory as part of
some larger project, but either way newvers.sh still tests for the .vcs
subdirectory.)

However, when using git worktree there is no .git subdirectory but
rather a plain text .git file which contains a reference to the main
working tree.

Change findvcs() to test that the .vcs entry exists, regardless of type.

Sponsored by: The FreeBSD Foundation
sys/conf/newvers.sh