Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-10-12 16:28:34 +0300
committerJunio C Hamano <gitster@pobox.com>2020-10-12 22:13:21 +0300
commitd334107c5da27e5212e21e77da03e938ea6db976 (patch)
tree8774649784216bb94515ff81d7eaa232ee28a224 /t/t7900-maintenance.sh
parent8f801804befa12a9c4ddff91275cf03612f1895d (diff)
maintenance: core.commitGraph=false prevents writes
Recently, a user had an issue due to combining fetch.writeCommitGraph=true with core.commitGraph=false. The root bug has been resolved by preventing commit-graph writes when core.commitGraph is disabled. This happens inside the 'git commit-graph write' command, but we can be more aware of this situation and prevent that process from ever starting in the 'commit-graph' maintenance task. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7900-maintenance.sh')
-rwxr-xr-xt/t7900-maintenance.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index ee1f4a7ae4..9776154a2a 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -52,6 +52,14 @@ test_expect_success 'run --task=<task>' '
test_subcommand git commit-graph write --split --reachable --no-progress <run-both.txt
'
+test_expect_success 'core.commitGraph=false prevents write process' '
+ GIT_TRACE2_EVENT="$(pwd)/no-commit-graph.txt" \
+ git -c core.commitGraph=false maintenance run \
+ --task=commit-graph 2>/dev/null &&
+ test_subcommand ! git commit-graph write --split --reachable --no-progress \
+ <no-commit-graph.txt
+'
+
test_expect_success 'commit-graph auto condition' '
COMMAND="maintenance run --task=commit-graph --auto --quiet" &&