Re: [PATCH 2/3] builtin/gc: fix condition for whether to write commit graphs
From: Patrick Steinhardt <hidden>
Date: 2025-12-11 05:48:56
On Wed, Dec 10, 2025 at 01:49:39PM -0600, Justin Tobler wrote:
On 25/12/05 09:19AM, Patrick Steinhardt wrote:quoted
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index 6b36f52df7..6f3117304f 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh@@ -206,6 +206,32 @@ test_expect_success 'commit-graph auto condition' ' test_subcommand $COMMIT_GRAPH_WRITE <cg-two-satisfied.txt ' +test_expect_success 'commit-graph auto condition with merges' ' + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + git config set maintenance.auto false && + git commit --allow-empty -m initial && + git switch --create feature && + git commit --allow-empty -m feature-1 && + git commit --allow-empty -m feature-2 && + git switch - && + git commit --allow-empty -m main-1 && + git commit --allow-empty -m main-2 && + git merge feature && + git branch -D feature &&If we left the feature branch instead of deleting it, would that help test that commits are not counted twice?
Indeed! I couldn't make any sense of the results at the beginning of writing this test, but now that I fixed the relveant bugs we can retain the branch. Patrick