diff options
author | Gerald Combs <gerald@wireshark.org> | 2022-10-20 15:33:38 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2022-10-20 15:39:53 -0700 |
commit | 1321de7dc38ad981ffd8910e7bd348bef2cb9de9 (patch) | |
tree | bbde90f61fe83de1dd328da9f741d0f0a38a1d56 /packaging | |
parent | 6d79c8c1f6b39bd7a1e31ac8dd2b29578bb72a38 (diff) |
Packaging: Fix our tarball commit logic.
If CI_COMMIT_SHA is set, it probably means we're building in GitLab CI.
Prefer it over our stash commit ID.
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/source/git-export-release.sh.in | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packaging/source/git-export-release.sh.in b/packaging/source/git-export-release.sh.in index cc6794d752..a3dc439c92 100755 --- a/packaging/source/git-export-release.sh.in +++ b/packaging/source/git-export-release.sh.in @@ -72,11 +72,16 @@ if [[ $COMMIT != \$F* ]] ; then exit 1 fi -COMMIT="${CI_COMMIT_SHA:-HEAD}" - STASH_ID=$(git stash create || echo "") -if [[ -n "$STASH_ID" ]] ; then + +if [[ -n "${CI_COMMIT_SHA-}" ]] ; then + echo "Setting commit from CI_COMMIT_SHA" + COMMIT="$CI_COMMIT_SHA" +elif [[ -n "$STASH_ID" ]] ; then + echo "Setting commit from stash" COMMIT="$STASH_ID" +else + COMMIT="HEAD" fi if [ -f "$TARBALL" ] ; then |