git-version: remove sha unconditionally

Like LFS.
This commit is contained in:
Xi Ruoyao 2021-10-17 03:20:45 +08:00
parent c99889d95e
commit 8025137e7c
No known key found for this signature in database
GPG Key ID: D95E4716CCBB34DC

View File

@ -32,10 +32,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
sha=$(echo "$sha" | sed 's/-g[^-]*$//')
fi
version="$sha"
version=$(echo "$sha" | sed 's/-g[^-]*$//')
if [ "$(git diff HEAD | wc -l)" != "0" ]; then
version="$version+"