diff --git a/scripts/promote.sh b/scripts/promote.sh index 233943c..b145780 100755 --- a/scripts/promote.sh +++ b/scripts/promote.sh @@ -22,5 +22,7 @@ git -C "$src" archive --format=tar "$tag" | tar -x -C "$pub" rm -rf "${pub:?}/.github" git -C "$pub" add -A -git -C "$pub" commit -q -m "$msg" +# --allow-empty: stable promotion re-tags the same source commit as the last beta, so the +# extracted tree is byte-identical and there is nothing to stage — still produce a release commit. +git -C "$pub" commit -q --allow-empty -m "$msg" git -C "$pub" tag "$tag" diff --git a/scripts/promote.test.sh b/scripts/promote.test.sh old mode 100644 new mode 100755 index ab54c5a..4632a5d --- a/scripts/promote.test.sh +++ b/scripts/promote.test.sh @@ -25,4 +25,12 @@ test ! -d "$work/pub/.github" || { echo "FAIL: .github leaked to public"; e test -d "$work/pub/.git" || { echo "FAIL: public .git clobbered"; exit 1; } git -C "$work/pub" rev-parse v1.0.0 >/dev/null 2>&1 || { echo "FAIL: tag missing"; exit 1; } git -C "$work/pub" log -1 --pretty=%s | grep -qx 'Release v1.0.0' || { echo "FAIL: commit message"; exit 1; } + +# Beta -> stable: stable re-tags the SAME source commit, so the extracted tree is byte-identical +# to the last promotion. Promote a second tag (same tree) into the SAME pub repo and assert it +# still creates the tag — guards against `git commit` aborting on "nothing to commit". +git -C "$work/src" tag v1.0.1 v1.0.0 +bash "$here/promote.sh" "$work/src" v1.0.1 "$work/pub" "Release v1.0.1" +git -C "$work/pub" rev-parse v1.0.1 >/dev/null 2>&1 || { echo "FAIL: identical-tree tag missing"; exit 1; } +git -C "$work/pub" log -1 --pretty=%s | grep -qx 'Release v1.0.1' || { echo "FAIL: identical-tree commit message"; exit 1; } echo "PASS"