This is a repeat of commit 3aa68cd3978b880b451cd41ac4f4ee4ff5c4cb2f
which was lost in a rework of version.sh.
git worktrees have a .git file rather than a .git directory, so building
in a worktree caused version.sh to generate an error.
Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>