aboutsummaryrefslogtreecommitdiffstats
path: root/git-version.sh
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@mengyan1223.wang>2021-05-02 16:21:50 +0800
committerXi Ruoyao <xry111@mengyan1223.wang>2021-05-02 16:22:08 +0800
commit54ee51d41d1fc4daa1d9581c9f25af9cd2378476 (patch)
treebcf02e0633abedc62ead3b4b416d500b0a6e9840 /git-version.sh
parent6ca780c12dc8d1257a6a6ab0665f11d00de99fe3 (diff)
git-version: fix trunk branch detection
Diffstat (limited to 'git-version.sh')
-rwxr-xr-xgit-version.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-version.sh b/git-version.sh
index 8fe051501..ff0eb6cdd 100755
--- a/git-version.sh
+++ b/git-version.sh
@@ -30,7 +30,7 @@ esac
full_date="$month $day$suffix, $year"
sha="$(git describe --abbrev=1)"
-if git describe --all --match trunk > /dev/null 2> /dev/null; then
+if [ "$(git branch --show-current)" = "trunk" ]; then
sha=$(echo "$sha" | sed 's/-g[^-]*$//')
fi
version="$sha"