summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-25 19:21:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-25 19:21:51 (GMT)
commitb7ce583682e26910c98e71d55babd2ed23a006ad (patch)
tree5782c8f1813906ee72002bbe9b5d0cf4101df7ab /t
parent9ce7100b1c1aa3a1523057c904f081abcf87ed60 (diff)
parentd078d85bc3cd74bbe1f230feb26cbe28f29d6d25 (diff)
downloadgit-b7ce583682e26910c98e71d55babd2ed23a006ad.zip
git-b7ce583682e26910c98e71d55babd2ed23a006ad.tar.gz
git-b7ce583682e26910c98e71d55babd2ed23a006ad.tar.bz2
Merge branch 'jk/repack-pack-keep-objects'
Recent updates to "git repack" started to duplicate objects that are in packfiles marked with .keep flag into the new packfile by mistake. * jk/repack-pack-keep-objects: repack: s/write_bitmap/&s/ in code repack: respect pack.writebitmaps repack: do not accidentally pack kept objects by default
Diffstat (limited to 't')
-rwxr-xr-xt/t7700-repack.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index 284018e..61e6ed3 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -35,9 +35,25 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
test -z "$found_duplicate_object"
'
-test_expect_success 'writing bitmaps can duplicate .keep objects' '
+test_expect_success 'writing bitmaps via command-line can duplicate .keep objects' '
# build on $objsha1, $packsha1, and .keep state from previous
- git repack -Adl &&
+ git repack -Adbl &&
+ test_when_finished "found_duplicate_object=" &&
+ for p in .git/objects/pack/*.idx; do
+ idx=$(basename $p)
+ test "pack-$packsha1.idx" = "$idx" && continue
+ if git verify-pack -v $p | egrep "^$objsha1"; then
+ found_duplicate_object=1
+ echo "DUPLICATE OBJECT FOUND"
+ break
+ fi
+ done &&
+ test "$found_duplicate_object" = 1
+'
+
+test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
+ # build on $objsha1, $packsha1, and .keep state from previous
+ git -c pack.writebitmaps=true repack -Adl &&
test_when_finished "found_duplicate_object=" &&
for p in .git/objects/pack/*.idx; do
idx=$(basename $p)