From: Brandon Casey Date: Sat, 21 Mar 2009 22:25:30 +0000 (-0500) Subject: t7700: demonstrate repack flaw which may loosen objects unnecessarily X-Git-Tag: v1.6.2.3~6^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=869a3d34c1aea92a10bc8eaa994bd55f4b0b04f2;p=git.git t7700: demonstrate repack flaw which may loosen objects unnecessarily If an unreferenced object exists in both a local pack and in either a pack residing in an alternate object database or a local kept pack, then the pack-objects call made by repack will loosen that object only to have it immediately pruned by repack's call to prune-packed. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh index 1ef3892f9..013e488bd 100755 --- a/t/t7700-repack.sh +++ b/t/t7700-repack.sh @@ -113,5 +113,22 @@ test_expect_success 'packed unreachable obs in alternate ODB are not loosened' ' test_must_fail git show $csha1 ' +test_expect_failure 'local packed unreachable obs that exist in alternate ODB are not loosened' ' + echo `pwd`/alt_objects > .git/objects/info/alternates && + echo "$csha1" | git pack-objects --non-empty --all --reflog pack && + rm -f .git/objects/pack/* && + mv pack-* .git/objects/pack/ && + # The pack-objects call on the next line is equivalent to + # git repack -A -d without the call to prune-packed + git pack-objects --honor-pack-keep --non-empty --all --reflog \ + --unpack-unreachable .git/objects/info/alternates && + test_must_fail git show $csha1 +' + test_done