diff options
Diffstat (limited to 'tools/meson-vcs-tag.sh')
-rwxr-xr-x | tools/meson-vcs-tag.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/meson-vcs-tag.sh b/tools/meson-vcs-tag.sh index 9b024c8c28..4345c2145a 100755 --- a/tools/meson-vcs-tag.sh +++ b/tools/meson-vcs-tag.sh @@ -3,7 +3,10 @@ set -eu set -o pipefail -gitdir="$1" +dir="$1" fallback="$2" -git --git-dir="$gitdir" describe --abbrev=7 --dirty=+ 2>/dev/null | sed 's/^v//' || echo "$fallback" +# Apparently git describe has a bug where it always considers the work-tree +# dirty when invoked with --git-dir (even though 'git status' is happy). Work +# around this issue by cd-ing to the source directory. +cd "$dir" && git describe --abbrev=7 --dirty=+ 2>/dev/null | sed 's/^v//' || echo "$fallback" |