File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -162,4 +162,18 @@ test_expect_success \
162162 ' [index v2] 5) pack-objects refuses to reuse corrupted data' \
163163 ' ! git pack-objects test-5 <obj-list'
164164
165+ test_expect_success \
166+ ' [index v2] 6) verify-pack detects CRC mismatch' \
167+ ' rm -f .git/objects/pack/* &&
168+ git-index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
169+ git verify-pack ".git/objects/pack/pack-${pack1}.pack" &&
170+ chmod +w ".git/objects/pack/pack-${pack1}.idx" &&
171+ dd if=/dev/zero of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \
172+ bs=1 count=4 seek=$((8 + 256 * 4 + `wc -l <obj-list` * 20 + 0)) &&
173+ ( while read obj
174+ do git cat-file -p $obj >/dev/null || exit 1
175+ done <obj-list ) &&
176+ err=$(! git verify-pack ".git/objects/pack/pack-${pack1}.pack" 2>&1) &&
177+ echo "$err" | grep "CRC mismatch"'
178+
165179test_done
You can’t perform that action at this time.
0 commit comments