aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-01-15 07:12:40 -0800
committerJunio C Hamano <gitster@pobox.com>2026-01-15 07:12:41 -0800
commit24c43fb10b7d8fb668740f28b107f9ecb73a268d (patch)
treeabcf709ab9449bab6d23903ebd988b9cc59c0a45 /t
parentc0453835ab4d507a48d536f8a6352ef03bcbd464 (diff)
parent3d099686560b848fefe71b7e8edf70d1674b9c73 (diff)
downloadgit-24c43fb10b7d8fb668740f28b107f9ecb73a268d.tar.xz
Merge branch 'ps/odb-misc-fixes'
Miscellaneous fixes on object database layer. * ps/odb-misc-fixes: odb: properly close sources before freeing them builtin/gc: fix condition for whether to write commit graphs
Diffstat (limited to 't')
-rwxr-xr-xt/t7900-maintenance.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 6b36f52df7..7cc0ce57f8 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -206,6 +206,31 @@ 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 &&
+ test_commit initial &&
+ git switch --create feature &&
+ test_commit feature-1 &&
+ test_commit feature-2 &&
+ git switch - &&
+ test_commit main-1 &&
+ test_commit main-2 &&
+ git merge feature &&
+
+ # We have 6 commits, none of which are covered by a commit
+ # graph. So this must be the boundary at which we start to
+ # perform maintenance.
+ test_must_fail git -c maintenance.commit-graph.auto=7 \
+ maintenance is-needed --auto --task=commit-graph &&
+ git -c maintenance.commit-graph.auto=6 \
+ maintenance is-needed --auto --task=commit-graph
+ )
+'
+
test_expect_success 'run --task=bogus' '
test_must_fail git maintenance run --task=bogus 2>err &&
test_grep "is not a valid task" err