Skip to content

Commit

Permalink
please.sh build_mingw_w64_git: allow multiple tags to point at HEAD
Browse files Browse the repository at this point in the history
If multiple tags point to HEAD, just use the first one.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Aug 13, 2021
1 parent 863470a commit f108b17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion please.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4814,7 +4814,7 @@ build_mingw_w64_git () { # [--only-32-bit] [--only-64-bit] [--skip-test-artifact
git clone --depth 1 --single-branch -b main https://github.com/git-for-windows/MINGW-packages /usr/src/MINGW-packages ||
die "Could not clone MINGW-packages\n"
tag="$(git for-each-ref --format '%(refname:short)' --points-at="${1:-HEAD}" 'refs/tags/v[0-9]*')"
tag="$(git for-each-ref --count=1 --format '%(refname:short)' --points-at="${1:-HEAD}" 'refs/tags/v[0-9]*')"
test -n "$tag" || {
tag=$(git describe --match=v* "${1:-HEAD}" | sed 's/-.*//').$(date +%Y%m%d%H%M%S) &&
git tag $tag "${1:-HEAD}"
Expand Down

0 comments on commit f108b17

Please sign in to comment.