Skip to content

Commit 3871bdb

Browse files
sunshinecogitster
authored andcommitted
t4301: emit blank line in more idiomatic fashion
The unusual use of: printf "\\n" >>file && may give readers pause, making them wonder why this form was chosen over the more typical: printf "\n" >>file && However, even that may give pause since it is a somewhat unusual and long-winded way of saying: echo >>file && Therefore, replace `printf` with the more idiomatic `echo`, with the hope of eliminating a possible stumbling block for those reading the code. Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 87ed971 commit 3871bdb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

t/t4301-merge-tree-write-tree.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ test_expect_success 'directory rename + content conflict' '
176176
177177
test_expect_code 1 \
178178
git merge-tree -z A^0 B^0 >out &&
179-
printf "\\n" >>out &&
179+
echo >>out &&
180180
anonymize_hash out >actual &&
181181
q_to_tab <<-\EOF | lf_to_nul >expect &&
182182
HASH
@@ -230,7 +230,7 @@ test_expect_success 'rename/delete handling' '
230230
231231
test_expect_code 1 \
232232
git merge-tree -z A^0 B^0 >out &&
233-
printf "\\n" >>out &&
233+
echo >>out &&
234234
anonymize_hash out >actual &&
235235
q_to_tab <<-\EOF | lf_to_nul >expect &&
236236
HASH
@@ -284,7 +284,7 @@ test_expect_success 'rename/add handling' '
284284
285285
test_expect_code 1 \
286286
git merge-tree -z A^0 B^0 >out &&
287-
printf "\\n" >>out &&
287+
echo >>out &&
288288
289289
#
290290
# First, check that the bar that appears at stage 3 does not
@@ -351,7 +351,7 @@ test_expect_success SYMLINKS 'rename/add, where add is a mode conflict' '
351351
352352
test_expect_code 1 \
353353
git merge-tree -z A^0 B^0 >out &&
354-
printf "\\n" >>out &&
354+
echo >>out &&
355355
356356
#
357357
# First, check that the bar that appears at stage 3 does not
@@ -417,7 +417,7 @@ test_expect_success 'rename/rename + content conflict' '
417417
418418
test_expect_code 1 \
419419
git merge-tree -z A^0 B^0 >out &&
420-
printf "\\n" >>out &&
420+
echo >>out &&
421421
anonymize_hash out >actual &&
422422
q_to_tab <<-\EOF | lf_to_nul >expect &&
423423
HASH
@@ -471,7 +471,7 @@ test_expect_success 'rename/add/delete conflict' '
471471
472472
test_expect_code 1 \
473473
git merge-tree -z B^0 A^0 >out &&
474-
printf "\\n" >>out &&
474+
echo >>out &&
475475
anonymize_hash out >actual &&
476476
477477
q_to_tab <<-\EOF | lf_to_nul >expect &&
@@ -528,7 +528,7 @@ test_expect_success 'rename/rename(2to1)/delete/delete conflict' '
528528
529529
test_expect_code 1 \
530530
git merge-tree -z A^0 B^0 >out &&
531-
printf "\\n" >>out &&
531+
echo >>out &&
532532
anonymize_hash out >actual &&
533533
534534
q_to_tab <<-\EOF | lf_to_nul >expect &&
@@ -600,7 +600,7 @@ test_expect_success 'mod6: chains of rename/rename(1to2) and add/add via collidi
600600
601601
test_expect_code 1 \
602602
git merge-tree -z A^0 B^0 >out &&
603-
printf "\\n" >>out &&
603+
echo >>out &&
604604
605605
#
606606
# First, check that some of the hashes that appear as stage
@@ -690,7 +690,7 @@ test_expect_success 'directory rename + rename/delete + modify/delete + director
690690
691691
test_expect_code 1 \
692692
git merge-tree -z A^0 B^0 >out &&
693-
printf "\\n" >>out &&
693+
echo >>out &&
694694
anonymize_hash out >actual &&
695695
696696
q_to_tab <<-\EOF | lf_to_nul >expect &&
@@ -760,7 +760,7 @@ test_expect_success 'NUL terminated conflicted file "lines"' '
760760
git commit -m "Renamed numbers" &&
761761
762762
test_expect_code 1 git merge-tree --write-tree -z tweak1 side2 >out &&
763-
printf "\\n" >>out &&
763+
echo >>out &&
764764
anonymize_hash out >actual &&
765765
766766
# Expected results:

0 commit comments

Comments
 (0)