{"thread":{"id":"18453","subject":"[PATCH 1/2] t7700: demonstrate repack flaw which may loosen objects unnecessarily","startedAt":"2009-03-21T22:22:30Z","lastAt":"2009-03-21T22:22:30Z","messageCount":1,"participants":["Brandon Casey"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"108841","messageId":"ee63ef30903211522k5694b936ma558513d35ac98d9@mail.gmail.com","threadId":"18453","inReplyTo":null,"subject":"[PATCH 1/2] t7700: demonstrate repack flaw which may loosen objects unnecessarily","fromName":"Brandon Casey","fromEmail":"drafnel@gmail.com","sentAt":"2009-03-21T22:22:30Z","receivedAt":"2009-03-21T22:22:30Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"If an unreferenced object exists in both a local pack and in either a pack\nresiding in an alternate object database or a local kept pack, then the\npack-objects call made by repack will loosen that object only to have it\nimmediately pruned by repack's call to prune-packed.\n---\n t/t7700-repack.sh |   17 +++++++++++++++++\n 1 files changed, 17 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t7700-repack.sh b/t/t7700-repack.sh\nindex 1ef3892..013e488 100755\n--- a/t/t7700-repack.sh\n+++ b/t/t7700-repack.sh\n@@ -113,5 +113,22 @@ test_expect_success 'packed unreachable obs in\nalternate ODB are not loosened' '\n \ttest_must_fail git show $csha1\n '\n\n+test_expect_failure 'local packed unreachable obs that exist in\nalternate ODB are not loosened' '\n+\techo `pwd`/alt_objects > .git/objects/info/alternates &&\n+\techo \"$csha1\" | git pack-objects --non-empty --all --reflog pack &&\n+\trm -f .git/objects/pack/* &&\n+\tmv pack-* .git/objects/pack/ &&\n+\t# The pack-objects call on the next line is equivalent to\n+\t# git repack -A -d without the call to prune-packed\n+\tgit pack-objects --honor-pack-keep --non-empty --all --reflog \\\n+\t    --unpack-unreachable </dev/null pack &&\n+\trm -f .git/objects/pack/* &&\n+\tmv pack-* .git/objects/pack/ &&\n+\ttest 0 = $(git verify-pack -v -- .git/objects/pack/*.idx |\n+\t\tegrep \"^$csha1 \" | sort | uniq | wc -l) &&\n+\techo > .git/objects/info/alternates &&\n+\ttest_must_fail git show $csha1\n+'\n+\n test_done\n\n-- \n1.6.2.12.g83676\n"}]}