aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorBrandon Casey <casey@nrlssc.navy.mil>2008-11-13 14:11:46 -0600
committerJunio C Hamano <gitster@pobox.com>2008-11-14 21:39:10 -0800
commit83d0289df6fb4deae100ee3fc37b90683c2e8c9f (patch)
tree0c863808154fd99432f37d205c286eda6512b622 /t
parent3289b9dec56d34fe05f90c262d11adc0a61e16e7 (diff)
downloadgit-83d0289df6fb4deae100ee3fc37b90683c2e8c9f.tar.gz
git-83d0289df6fb4deae100ee3fc37b90683c2e8c9f.tar.xz
repack: only unpack-unreachable if we are deleting redundant packs
The -A option calls pack-objects with the --unpack-unreachable option so that the unreachable objects in local packs are left in the local object store loose. But if the -d option to repack was _not_ used, then these unpacked loose objects are redundant and unnecessary. Update tests in t7701. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7701-repack-unpack-unreachable.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index 531dac060..9813f113a 100755
--- a/t/t7701-repack-unpack-unreachable.sh
+++ b/t/t7701-repack-unpack-unreachable.sh
@@ -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 &&
@@ -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 @@ test_expect_success 'unpacked objects receive timestamp of pack file' '
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