summaryrefslogtreecommitdiff
path: root/t/t4124-apply-ws-rule.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t4124-apply-ws-rule.sh')
-rwxr-xr-xt/t4124-apply-ws-rule.sh58
1 files changed, 29 insertions, 29 deletions
diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh
index 0ca29821ec..485c7d2d12 100755
--- a/t/t4124-apply-ws-rule.sh
+++ b/t/t4124-apply-ws-rule.sh
@@ -230,10 +230,10 @@ test_expect_success 'blank at EOF with --whitespace=fix (1)' '
test_might_fail git config --unset core.whitespace &&
rm -f .gitattributes &&
- { echo a; echo b; echo c; } >one &&
+ test_write_lines a b c >one &&
git add one &&
- { echo a; echo b; echo c; } >expect &&
- { cat expect; echo; } >one &&
+ test_write_lines a b c >expect &&
+ { cat expect && echo; } >one &&
git diff -- one >patch &&
git checkout one &&
@@ -242,10 +242,10 @@ test_expect_success 'blank at EOF with --whitespace=fix (1)' '
'
test_expect_success 'blank at EOF with --whitespace=fix (2)' '
- { echo a; echo b; echo c; } >one &&
+ test_write_lines a b c >one &&
git add one &&
- { echo a; echo c; } >expect &&
- { cat expect; echo; echo; } >one &&
+ test_write_lines a b >expect &&
+ { cat expect && test_write_lines "" ""; } >one &&
git diff -- one >patch &&
git checkout one &&
@@ -254,10 +254,10 @@ test_expect_success 'blank at EOF with --whitespace=fix (2)' '
'
test_expect_success 'blank at EOF with --whitespace=fix (3)' '
- { echo a; echo b; echo; } >one &&
+ test_write_lines a b "" >one &&
git add one &&
- { echo a; echo c; echo; } >expect &&
- { cat expect; echo; echo; } >one &&
+ test_write_lines a c "" >expect &&
+ { cat expect && test_write_lines "" ""; } >one &&
git diff -- one >patch &&
git checkout one &&
@@ -266,9 +266,9 @@ test_expect_success 'blank at EOF with --whitespace=fix (3)' '
'
test_expect_success 'blank at end of hunk, not at EOF with --whitespace=fix' '
- { echo a; echo b; echo; echo; echo; echo; echo; echo d; } >one &&
+ test_write_lines a b "" "" "" "" "" d >one &&
git add one &&
- { echo a; echo c; echo; echo; echo; echo; echo; echo; echo d; } >expect &&
+ test_write_lines a b "" "" "" "" "" "" d >expect &&
cp expect one &&
git diff -- one >patch &&
@@ -278,7 +278,7 @@ test_expect_success 'blank at end of hunk, not at EOF with --whitespace=fix' '
'
test_expect_success 'blank at EOF with --whitespace=warn' '
- { echo a; echo b; echo c; } >one &&
+ test_write_lines a b c >one &&
git add one &&
echo >>one &&
cat one >expect &&
@@ -291,7 +291,7 @@ test_expect_success 'blank at EOF with --whitespace=warn' '
'
test_expect_success 'blank at EOF with --whitespace=error' '
- { echo a; echo b; echo c; } >one &&
+ test_write_lines a b c >one &&
git add one &&
cat one >expect &&
echo >>one &&
@@ -304,7 +304,7 @@ test_expect_success 'blank at EOF with --whitespace=error' '
'
test_expect_success 'blank but not empty at EOF' '
- { echo a; echo b; echo c; } >one &&
+ test_write_lines a b c >one &&
git add one &&
echo " " >>one &&
cat one >expect &&
@@ -317,13 +317,13 @@ test_expect_success 'blank but not empty at EOF' '
'
test_expect_success 'applying beyond EOF requires one non-blank context line' '
- { echo; echo; echo; echo; } >one &&
+ test_write_lines "" "" "" "" >one &&
git add one &&
- { echo b; } >>one &&
+ echo b >>one &&
git diff -- one >patch &&
git checkout one &&
- { echo a; echo; } >one &&
+ test_write_lines a "" >one &&
cp one expect &&
test_must_fail git apply --whitespace=fix patch &&
test_cmp expect one &&
@@ -333,7 +333,7 @@ test_expect_success 'applying beyond EOF requires one non-blank context line' '
test_expect_success 'tons of blanks at EOF should not apply' '
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
- echo; echo; echo; echo;
+ test_write_lines "" "" "" "" || return 1
done >one &&
git add one &&
echo a >>one &&
@@ -362,9 +362,9 @@ test_expect_success 'missing blank line at end with --whitespace=fix' '
'
test_expect_success 'two missing blank lines at end with --whitespace=fix' '
- { echo a; echo; echo b; echo c; } >one &&
+ test_write_lines a "" b c >one &&
cp one no-blank-lines &&
- { echo; echo; } >>one &&
+ test_write_lines "" "" >>one &&
git add one &&
echo d >>one &&
cp one expect &&
@@ -381,9 +381,9 @@ test_expect_success 'two missing blank lines at end with --whitespace=fix' '
'
test_expect_success 'missing blank line at end, insert before end, --whitespace=fix' '
- { echo a; echo; } >one &&
+ test_write_lines a "" >one &&
git add one &&
- { echo b; echo a; echo; } >one &&
+ test_write_lines b a "" >one &&
cp one expect &&
git diff -- one >patch &&
echo a >one &&
@@ -393,10 +393,10 @@ test_expect_success 'missing blank line at end, insert before end, --whitespace=
'
test_expect_success 'shrink file with tons of missing blanks at end of file' '
- { echo a; echo b; echo c; } >one &&
+ test_write_lines a b c >one &&
cp one no-blank-lines &&
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
- echo; echo; echo; echo;
+ test_write_lines "" "" "" "" || return 1
done >>one &&
git add one &&
echo a >one &&
@@ -412,9 +412,9 @@ test_expect_success 'shrink file with tons of missing blanks at end of file' '
'
test_expect_success 'missing blanks at EOF must only match blank lines' '
- { echo a; echo b; } >one &&
+ test_write_lines a b >one &&
git add one &&
- { echo c; echo d; } >>one &&
+ test_write_lines c d >>one &&
git diff -- one >patch &&
echo a >one &&
@@ -434,9 +434,9 @@ test_expect_success 'missing blank line should match context line with spaces' '
git add one &&
echo d >>one &&
git diff -- one >patch &&
- { echo a; echo b; echo c; } >one &&
+ test_write_lines a b c >one &&
cp one expect &&
- { echo; echo d; } >>expect &&
+ test_write_lines "" d >>expect &&
git add one &&
git apply --whitespace=fix patch &&
@@ -455,7 +455,7 @@ test_expect_success 'same, but with the --ignore-space-option' '
echo d >>one &&
cp one expect &&
git diff -- one >patch &&
- { echo a; echo b; echo c; } >one &&
+ test_write_lines a b c >one &&
git add one &&
git checkout-index -f one &&