From: Junio C Hamano Date: Sun, 16 Nov 2008 08:49:02 +0000 (-0800) Subject: Merge branch 'bc/maint-keep-pack' X-Git-Tag: v1.6.1-rc1~41 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c9d8563c815a6a90bcc15057de288684d7cae5ef?ds=inline;hp=-c Merge branch 'bc/maint-keep-pack' * bc/maint-keep-pack: repack: only unpack-unreachable if we are deleting redundant packs --- c9d8563c815a6a90bcc15057de288684d7cae5ef diff --combined t/t7701-repack-unpack-unreachable.sh index b48046e261,9813f113a2..63a8225ae5 --- a/t/t7701-repack-unpack-unreachable.sh +++ b/t/t7701-repack-unpack-unreachable.sh @@@ -8,7 -8,7 +8,7 @@@ fsha1 csha1= tsha1= - test_expect_success '-A option leaves unreachable objects unpacked' ' + test_expect_success '-A with -d option leaves unreachable objects unpacked' ' echo content > file1 && git add . && git commit -m initial_commit && @@@ -29,7 -29,7 +29,7 @@@ git repack -A -d -l && # verify objects are packed in repository test 3 = $(git verify-pack -v -- .git/objects/pack/*.idx | - grep -e "^$fsha1 " -e "^$csha1 " -e "^$tsha1 " | + egrep "^($fsha1|$csha1|$tsha1) " | sort | uniq | wc -l) && git show $fsha1 && git show $csha1 && @@@ -41,7 -41,7 +41,7 @@@ git repack -A -d -l && # verify objects are retained unpacked test 0 = $(git verify-pack -v -- .git/objects/pack/*.idx | - grep -e "^$fsha1 " -e "^$csha1 " -e "^$tsha1 " | + egrep "^($fsha1|$csha1|$tsha1) " | sort | uniq | wc -l) && git show $fsha1 && git show $csha1 && @@@ -58,7 -58,7 +58,7 @@@ compare_mtimes ( ' -- "$@" } - test_expect_success 'unpacked objects receive timestamp of pack file' ' + test_expect_success '-A without -d option leaves unreachable objects packed' ' fsha1path=$(echo "$fsha1" | sed -e "s|\(..\)|\1/|") && fsha1path=".git/objects/$fsha1path" && csha1path=$(echo "$csha1" | sed -e "s|\(..\)|\1/|") && @@@ -75,7 -75,19 +75,19 @@@ git branch -D transient_branch && sleep 1 && git repack -A -l && - compare_mtimes "$packfile" "$fsha1path" "$csha1path" "$tsha1path" + test ! -f "$fsha1path" && + test ! -f "$csha1path" && + test ! -f "$tsha1path" && + git show $fsha1 && + git show $csha1 && + git show $tsha1 + ' + + test_expect_success 'unpacked objects receive timestamp of pack file' ' + tmppack=".git/objects/pack/tmp_pack" && + ln "$packfile" "$tmppack" && + git repack -A -l -d && + compare_mtimes "$tmppack" "$fsha1path" "$csha1path" "$tsha1path" ' test_done