mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
version: relax git detection logic
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>
This commit is contained in:
parent
119101962c
commit
3aa68cd397
@ -12,7 +12,7 @@ case $# in
|
||||
if [ -z "$extra_hash" ]; then
|
||||
# Nothing, empty extra hash is fine.
|
||||
extra_hash=""
|
||||
elif [ -d "$extra_hash/.git" ]; then
|
||||
elif [ -e "$extra_hash/.git" ]; then
|
||||
extra_hash=$(cd "$extra_hash" && git describe --always --dirty --exclude '*' --abbrev=200)
|
||||
elif ! expr "$extra_hash" : "^[0-9a-f]*$"; then
|
||||
echo "Invalid extra hash '$extra_hash', must be a git commit hash or path to a git repo" >&2
|
||||
|
Loading…
Reference in New Issue
Block a user