aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-04-29 17:50:27 -0700
committerJunio C Hamano <gitster@pobox.com>2012-04-29 17:50:27 -0700
commit9e234af281107d44116ecf31eef65de145c46d15 (patch)
tree62c390006f12c74171e5cfcb6c39ff16089570d1 /t
parent4b2a0f820c32d40f2d58cf2551469290b725248d (diff)
parent234587fc87b156dc20461fc61353beeb904b43bc (diff)
downloadgit-9e234af281107d44116ecf31eef65de145c46d15.tar.gz
git-9e234af281107d44116ecf31eef65de145c46d15.tar.xz
Merge branch 'jk/repack-no-explode-objects-from-old-pack'
Avoid writing out unreachable objects as loose objects when repacking, if such loose objects will immediately pruned due to its age anyway. By Jeff King * jk/repack-no-explode-objects-from-old-pack: gc: use argv-array for sub-commands argv-array: add a new "pushl" method argv-array: refactor empty_argv initialization gc: do not explode objects which will be immediately pruned
Diffstat (limited to 't')
-rwxr-xr-xt/t7701-repack-unpack-unreachable.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index 200ab6127..b8d4cdea8 100755
--- a/t/t7701-repack-unpack-unreachable.sh
+++ b/t/t7701-repack-unpack-unreachable.sh
@@ -95,4 +95,18 @@ test_expect_success 'unpacked objects receive timestamp of pack file' '
compare_mtimes < mtimes
'
+test_expect_success 'do not bother loosening old objects' '
+ obj1=$(echo one | git hash-object -w --stdin) &&
+ obj2=$(echo two | git hash-object -w --stdin) &&
+ pack1=$(echo $obj1 | git pack-objects .git/objects/pack/pack) &&
+ pack2=$(echo $obj2 | git pack-objects .git/objects/pack/pack) &&
+ git prune-packed &&
+ git cat-file -p $obj1 &&
+ git cat-file -p $obj2 &&
+ test-chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
+ git repack -A -d --unpack-unreachable=1.hour.ago &&
+ git cat-file -p $obj1 &&
+ test_must_fail git cat-file -p $obj2
+'
+
test_done