From 50fb51e7e81748182a770d3943ec5730357b27e7 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 2 Oct 2012 11:50:16 -0700 Subject: t4055: avoid use of sed 'a' command The 'a', 'i' and 'c' commands take a literal text to be added followed by backslash, but then in the source we cannot indent the literal text which makes it ugly. We need to also remember to double the backslash inside double quotes. Avoid these issues altogether by having an extra line in a template file and generate test vectors by deleting the line or replacing the line and not using the 'a' command. Signed-off-by: Junio C Hamano diff --git a/t/t4055-diff-context.sh b/t/t4055-diff-context.sh index 3527686..97172b4 100755 --- a/t/t4055-diff-context.sh +++ b/t/t4055-diff-context.sh @@ -8,7 +8,7 @@ test_description='diff.context configuration' . ./test-lib.sh test_expect_success 'setup' ' - cat >x <<-\EOF && + cat >template <<-\EOF && firstline b c @@ -16,6 +16,7 @@ test_expect_success 'setup' ' e f preline + TARGET postline i j @@ -24,17 +25,15 @@ test_expect_success 'setup' ' m n EOF + sed "/TARGET/d" >x