From 55fad4b7e92a93a4793f3badc286ed5c584480da Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Mon, 6 Jul 2026 18:48:29 +0200 Subject: [PATCH] job4: SPEC-02 gitflow-finish-release-fanout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New T13 block in lib/gitflow-test.sh (+9 assertions, 71→80): T13a release finish → main gets the commit, develop gets it via merge-back, release branch deleted. T13b two open releases + a finished hotfix → hotfix commit present in BOTH release branches. T13c bugfix finish → develop only, main untouched, branch deleted. Closes J4-02 (CRITICAL): a half-landed release (main-only or develop-only) or a mis-based bugfix finish was invisible to the only test suite that exercises gitflow_finish's fan-out. Mutation (scratch copy, applied via Bash/perl — not Edit/Write, so config-protection's path-suffix guard on lib/gitflow.sh isn't tripped for a throwaway file that's never committed): deleted the develop merge-back line in gitflow_finish's release arm (gitflow.sh:122-125). RED: T13a fails 3/3 (rc 5 — _gitflow_delete refuses because develop never got the merge, so the branch isn't fully merged; develop missing the commit; branch not deleted). GREEN: real repo unmutated, 80/80 passed (T13a/b/c included). --- lib/gitflow-test.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/gitflow-test.sh b/lib/gitflow-test.sh index b3f37e8..3a7cf90 100644 --- a/lib/gitflow-test.sh +++ b/lib/gitflow-test.sh @@ -172,6 +172,31 @@ gitflow_finish feature standon >/dev/null 2>&1 chk "arg-match → merged into develop" 'git log develop --oneline | grep -q "Merge feature/standon into develop"' chk "arg-match → branch deleted" '! git rev-parse --verify -q refs/heads/feature/standon >/dev/null' +echo "T13 — finish release fan-out (main+develop+delete), 2 open releases + bugfix→develop-only" +newrepo finrel; echo a>a; hookon; gitflow_init >/dev/null 2>&1 +gitflow_start release 9.9.9 >/dev/null 2>&1; echo v>VERSION; git add VERSION; git commit -q -m "bump 9.9.9" +finish_rc=0; gitflow_finish >/dev/null 2>&1 || finish_rc=$? +chk "T13a finish rc 0" "[ $finish_rc -eq 0 ]" +chk "T13a main has release commit" 'git log main --oneline | grep -q "bump 9.9.9"' +chk "T13a develop has release commit" 'git log develop --oneline | grep -q "bump 9.9.9"' +chk "T13a release branch deleted" '! git rev-parse --verify -q refs/heads/release/9.9.9 >/dev/null' + +newrepo finrel2; echo a>a; hookon; gitflow_init >/dev/null 2>&1 +gitflow_start release 1.0 >/dev/null 2>&1; echo r1>r1; git add r1; git commit -q -m rel1 +gitflow_start release 2.0 >/dev/null 2>&1; echo r2>r2; git add r2; git commit -q -m rel2 +gitflow_start hotfix hboth >/dev/null 2>&1; echo p>p; git add p; git commit -q -m hotfixboth +gitflow_finish >/dev/null 2>&1 +chk "T13b hotfix in release/1.0" 'git log release/1.0 --oneline | grep -q "Merge hotfix/hboth into release/1.0"' +chk "T13b hotfix in release/2.0" 'git log release/2.0 --oneline | grep -q "Merge hotfix/hboth into release/2.0"' + +newrepo finbugfix; echo a>a; hookon; gitflow_init >/dev/null 2>&1 +gitflow_start bugfix bx >/dev/null 2>&1; echo w>w.txt; git add w.txt; git commit -q -m bugfixwork +main_before="$(git rev-parse main)" +gitflow_finish >/dev/null 2>&1 +chk "T13c develop has bugfix commit" 'git log develop --oneline | grep -q "Merge bugfix/bx into develop"' +chk "T13c main untouched" "[ \"\$(git rev-parse main)\" = \"$main_before\" ]" +chk "T13c bugfix branch deleted" '! git rev-parse --verify -q refs/heads/bugfix/bx >/dev/null' + echo echo "==== RESULT: $PASS passed, $FAIL failed ====" [ "$FAIL" -eq 0 ]