diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-06-25 23:21:51 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-25 23:21:51 +0400 |
commit | b7ce583682e26910c98e71d55babd2ed23a006ad (patch) | |
tree | 5782c8f1813906ee72002bbe9b5d0cf4101df7ab /t | |
parent | 9ce7100b1c1aa3a1523057c904f081abcf87ed60 (diff) | |
parent | d078d85bc3cd74bbe1f230feb26cbe28f29d6d25 (diff) |
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-x | t/t7700-repack.sh | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh index 284018e3cd..61e6ed37aa 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) |