diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-29 17:50:27 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-29 17:50:27 -0700 |
commit | 9e234af281107d44116ecf31eef65de145c46d15 (patch) | |
tree | 62c390006f12c74171e5cfcb6c39ff16089570d1 /t | |
parent | Merge git://git.bogomips.org/git-svn (diff) | |
parent | gc: use argv-array for sub-commands (diff) | |
download | tgif-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-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 |