newvers.sh: accommodate `git worktree`
authoremaste <emaste@FreeBSD.org>
Tue, 22 Aug 2017 17:57:34 +0000 (17:57 +0000)
committeremaste <emaste@FreeBSD.org>
Tue, 22 Aug 2017 17:57:34 +0000 (17:57 +0000)
commit04db41849c16a0a077df5651c06b0e5279c2c074
tree1e67200fbf2cbd17e359f5333417fc97c003275b
parent9d83961b969676dd685d97f591bed3810fb7114e
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 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.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
sys/conf/newvers.sh