summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Brandon Casey <drafnel@gmail.com>2009-03-21 17:26:11 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-03-21 21:58:44 -0700
commit094085e3362c592c932b41525ed37152ec171192 (patch)
treee67eb0f1ca5716848e866c25e4a96464a46ad1a9 /t
parentt7700: demonstrate repack flaw which may loosen objects unnecessarily (diff)
downloadtgif-094085e3362c592c932b41525ed37152ec171192.tar.xz
pack-objects: don't loosen objects available in alternate or kept packs
If pack-objects is called with the --unpack-unreachable option then it will unpack (i.e. loosen) all unreferenced objects from local not-kept packs, including those that also exist in packs residing in an alternate object database or a locally kept pack. The only user of this option is git-repack. In this case, repack will follow the call to pack-objects with a call to prune-packed, which will delete these newly loosened objects, making the act of loosening a waste of time. The unnecessary loosening can be avoided by checking whether an object exists in a non-local pack or a locally kept pack before loosening it. This fixes the 'local packed unreachable obs that exist in alternate ODB are not loosened' test in t7700. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7700-repack.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index 013e488bdd..9ce546e3b2 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -113,7 +113,7 @@ 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' '
+test_expect_success '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/* &&