diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-05-11 11:16:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-11 11:16:45 -0700 |
commit | 285005c8c405fb1ea2226cff06aa6ac1029b9db1 (patch) | |
tree | 3c8d996b50264478361f30043ea29f2e3df4f277 /t | |
parent | f5f37461a9d261938ca2bdd9cfcc0da1268f45af (diff) | |
parent | 234587fc87b156dc20461fc61353beeb904b43bc (diff) | |
download | git-285005c8c405fb1ea2226cff06aa6ac1029b9db1.tar.gz |
Merge branch 'jk/repack-no-explode-objects-from-old-pack' into maint
"git repack" used to write out unreachable objects as loose objects
when repacking, even if such loose objects will immediately pruned
due to its age.
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-x | t/t7701-repack-unpack-unreachable.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh index 200ab61278..b8d4cdea8c 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 |