summaryrefslogtreecommitdiff
path: root/t/t5324-split-commit-graph.sh
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-06-18 18:14:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-20 03:46:26 (GMT)
commitba41112a6331e8b454cac6cfd3ee67ae93957a2c (patch)
tree10fc409a0ff2b2cb88ee4c8809877e663175b3dd /t/t5324-split-commit-graph.sh
parent3da4b609bb14b13672f64af908706462617f53cb (diff)
downloadgit-ba41112a6331e8b454cac6cfd3ee67ae93957a2c.zip
git-ba41112a6331e8b454cac6cfd3ee67ae93957a2c.tar.gz
git-ba41112a6331e8b454cac6cfd3ee67ae93957a2c.tar.bz2
commit-graph: clean up chains after flattened write
If we write a commit-graph file without the split option, then we write to $OBJDIR/info/commit-graph and start to ignore the chains in $OBJDIR/info/commit-graphs/. Unlink the commit-graph-chain file and expire the graph-{hash}.graph files in $OBJDIR/info/commit-graphs/ during every write. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5324-split-commit-graph.sh')
-rwxr-xr-xt/t5324-split-commit-graph.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh
index 3df90ae..e8df35c 100755
--- a/t/t5324-split-commit-graph.sh
+++ b/t/t5324-split-commit-graph.sh
@@ -216,6 +216,18 @@ test_expect_success 'test merge stragety constants' '
)
'
+test_expect_success 'remove commit-graph-chain file after flattening' '
+ git clone . flatten &&
+ (
+ cd flatten &&
+ test_line_count = 2 $graphdir/commit-graph-chain &&
+ git commit-graph write --reachable &&
+ test_path_is_missing $graphdir/commit-graph-chain &&
+ ls $graphdir >graph-files &&
+ test_line_count = 0 graph-files
+ )
+'
+
corrupt_file() {
file=$1
pos=$2