Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 5/9] add test for streaming corrupt blobs

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:32

Jeff King [off-list ref] writes:
quoted hunk
On Mon, Mar 25, 2013 at 04:21:34PM -0400, Jeff King wrote:
quoted
+# Convert byte at offset "$2" of object "$1" into '\0'
+corrupt_byte() {
+	obj_file=$(obj_to_file "$1") &&
+	chmod +w "$obj_file" &&
+	printf '\0' | dd of="$obj_file" bs=1 seek="$2"
+}
Hmm, this last line should probably be:
diff --git a/t/t1060-object-corruption.sh b/t/t1060-object-corruption.sh
index a84deb1..3f87051 100755
--- a/t/t1060-object-corruption.sh
+++ b/t/t1060-object-corruption.sh
@@ -12,7 +12,7 @@ corrupt_byte() {
 corrupt_byte() {
 	obj_file=$(obj_to_file "$1") &&
 	chmod +w "$obj_file" &&
-	printf '\0' | dd of="$obj_file" bs=1 seek="$2"
+	printf '\0' | dd of="$obj_file" bs=1 seek="$2" conv=notrunc
 }
 
 test_expect_success 'setup corrupt repo' '
The intent was to change a single byte, not truncate the file (though on
the plus side, that truncation is what found the other bugs).
;-).  Thanks, I missed that.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help