diff --git a/contrib/guix/libexec/codesign.sh b/contrib/guix/libexec/codesign.sh index 59df8e87fac223..137dbe4427590f 100755 --- a/contrib/guix/libexec/codesign.sh +++ b/contrib/guix/libexec/codesign.sh @@ -38,12 +38,8 @@ ACTUAL_OUTDIR="${OUTDIR}" OUTDIR="${DISTSRC}/output" git_head_version() { - local recent_tag - if recent_tag="$(git -C "$1" describe --exact-match HEAD 2> /dev/null)"; then - echo "${recent_tag#v}" - else - git -C "$1" rev-parse --short=12 HEAD - fi + recent_tag="$(git -C "$1" describe --abbrev=12 --dirty 2> /dev/null)" + echo "${recent_tag#v}" } CODESIGNATURE_GIT_ARCHIVE="${DIST_ARCHIVE_BASE}/${DISTNAME}-codesignatures-$(git_head_version "$DETACHED_SIGS_REPO").tar.gz" diff --git a/contrib/shell/git-utils.bash b/contrib/shell/git-utils.bash index 37bac1f38d8f08..1371c3df70c0f6 100644 --- a/contrib/shell/git-utils.bash +++ b/contrib/shell/git-utils.bash @@ -5,10 +5,6 @@ git_root() { } git_head_version() { - local recent_tag - if recent_tag="$(git describe --exact-match HEAD 2> /dev/null)"; then - echo "${recent_tag#v}" - else - git rev-parse --short=12 HEAD - fi + recent_tag="$(git describe --abbrev=12 --dirty 2> /dev/null)" + echo "${recent_tag#v}" }