summaryrefslogtreecommitdiff
path: root/t/t7700-repack.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-18 13:50:29 -0700
committerJunio C Hamano <gitster@pobox.com>2014-03-18 13:50:29 -0700
commit249d54b2311f1ca866dc2ce87c207d700d071101 (patch)
treebb1ac0824918f3eaf9720b93d9f6c5df1c1e8b37 /t/t7700-repack.sh
parentf4eec8ce05e725a5e30d3d29c47093d4e3e0ce7e (diff)
parentee34a2beadb94a9595f09af719e3c09b485ca797 (diff)
downloadgit-249d54b2311f1ca866dc2ce87c207d700d071101.tar.gz
Merge branch 'jk/repack-pack-keep-objects'
* jk/repack-pack-keep-objects: repack: add `repack.packKeptObjects` config var
Diffstat (limited to 't/t7700-repack.sh')
-rwxr-xr-xt/t7700-repack.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index b45bd1e76c..284018e3cd 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -21,7 +21,7 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
objsha1=$(git verify-pack -v pack-$packsha1.idx | head -n 1 |
sed -e "s/^\([0-9a-f]\{40\}\).*/\1/") &&
mv pack-* .git/objects/pack/ &&
- git repack -A -d -l &&
+ git repack --no-pack-kept-objects -A -d -l &&
git prune-packed &&
for p in .git/objects/pack/*.idx; do
idx=$(basename $p)
@@ -35,6 +35,22 @@ 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' '
+ # build on $objsha1, $packsha1, and .keep state from previous
+ git repack -Adl &&
+ 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 'loose objects in alternate ODB are not repacked' '
mkdir alt_objects &&
echo `pwd`/alt_objects > .git/objects/info/alternates &&