aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2022-06-16 13:13:48 +0000
committerJunio C Hamano <gitster@pobox.com>2022-06-16 11:59:55 -0700
commit9aa1cba01a90a82dc798cc6d2f18074335f24d2e (patch)
tree559ba1367544be0c48ee21c600f5a10d4cba1161
parentt2107: test 'git update-index --verbose' (diff)
downloadgit-9aa1cba01a90a82dc798cc6d2f18074335f24d2e.tar.gz
git-9aa1cba01a90a82dc798cc6d2f18074335f24d2e.zip
t5329: test 'git gc --cruft' without '--prune=now'
Replace a 'git repack --cruft -d' with the wrapper 'git gc --cruft' to exercise some logic in builtin/gc.c that adds the '--cruft' option to the underlying 'git repack' command. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t5329-pack-objects-cruft.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/t5329-pack-objects-cruft.sh b/t/t5329-pack-objects-cruft.sh
index b481224b93..8968f7a08d 100755
--- a/t/t5329-pack-objects-cruft.sh
+++ b/t/t5329-pack-objects-cruft.sh
@@ -451,11 +451,13 @@ test_expect_success 'expiring cruft objects with git gc' '
sort <reachable.raw >reachable &&
comm -13 reachable objects >unreachable &&
- git repack --cruft -d &&
+ # Write a cruft pack containing all unreachable objects.
+ git gc --cruft --prune="01-01-1980" &&
mtimes=$(ls .git/objects/pack/pack-*.mtimes) &&
test_path_is_file $mtimes &&
+ # Prune all unreachable objects from the cruft pack.
git gc --cruft --prune=now &&
git cat-file --batch-all-objects --batch-check="%(objectname)" >objects &&