From 54ee51d41d1fc4daa1d9581c9f25af9cd2378476 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 2 May 2021 16:21:50 +0800 Subject: [PATCH] git-version: fix trunk branch detection --- git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"