summaryrefslogtreecommitdiff
path: root/t/t5303-pack-corruption-resilience.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-06-14 21:51:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-14 21:56:08 (GMT)
commit50b72ede0592b16cb62e1b92d52bdccc4cee9b20 (patch)
treeed1cdf83375a8a857a08b4a549b3674c6a3dcf57 /t/t5303-pack-corruption-resilience.sh
parentf2b4626d9e78e00d2168a8470633d6c7f5331a13 (diff)
downloadgit-50b72ede0592b16cb62e1b92d52bdccc4cee9b20.zip
git-50b72ede0592b16cb62e1b92d52bdccc4cee9b20.tar.gz
git-50b72ede0592b16cb62e1b92d52bdccc4cee9b20.tar.bz2
t5303: drop "count=1" from corruption dd
This test corrupts pack objects by using "dd" with a seek command. It passes "count=1 bs=1" to munge just a single byte. However, the test added in commit b3118bdc wants to munge two bytes, and the second byte of corruption is silently ignored. This turned out not to impact the test, however. The idea was to reduce the "size of this entry" part of the header so that zlib runs out of input bytes while inflating the entry. That header is two bytes long, and the test reduced the value of both bytes; since we experience the problem if we are off by even 1 byte, it is sufficient to munge only the first one. Even though the test would have worked with only a single byte munged, and we could simply tweak the test to use a single byte, it makes sense to lift this 1-byte restriction from do_corrupt_object. It will allow future tests that do need to change multiple bytes to do so. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5303-pack-corruption-resilience.sh')
-rwxr-xr-xt/t5303-pack-corruption-resilience.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t5303-pack-corruption-resilience.sh b/t/t5303-pack-corruption-resilience.sh
index 5b1250f..9cb8172 100755
--- a/t/t5303-pack-corruption-resilience.sh
+++ b/t/t5303-pack-corruption-resilience.sh
@@ -51,7 +51,7 @@ do_corrupt_object() {
ofs=`git show-index < ${pack}.idx | grep $1 | cut -f1 -d" "` &&
ofs=$(($ofs + $2)) &&
chmod +w ${pack}.pack &&
- dd of=${pack}.pack count=1 bs=1 conv=notrunc seek=$ofs &&
+ dd of=${pack}.pack bs=1 conv=notrunc seek=$ofs &&
test_must_fail git verify-pack ${pack}.pack
}