Skip to content

Commit e28ae50

Browse files
peffgitster
authored andcommitted
diff-highlight: prefer "echo" to "cat" in tests
We generate a bunch of one-line files whose contents match their names, and then generate our commits by cat-ing those files. Let's just echo the contents directly, which saves some processes. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 53ab9f0 commit e28ae50

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

contrib/diff-highlight/t/t9400-diff-highlight.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,22 @@ test_strip_patch_header () {
6868
# D
6969
#
7070
dh_test_setup_history () {
71-
echo "file1" >file1 &&
72-
echo "file2" >file2 &&
73-
echo "file3" >file3 &&
74-
75-
cat file1 >file &&
71+
echo file1 >file &&
7672
git add file &&
7773
test_tick &&
7874
git commit -m "D" &&
7975

8076
git checkout -b branch &&
81-
cat file2 >file &&
77+
echo file2 >file &&
8278
test_tick &&
8379
git commit -a -m "E" &&
8480

85-
cat file3 >file &&
81+
echo file3 >file &&
8682
test_tick &&
8783
git commit -a -m "F" &&
8884

8985
git checkout master &&
90-
cat file2 >file &&
86+
echo file2 >file &&
9187
test_tick &&
9288
git commit -a -m "A"
9389
}

0 commit comments

Comments
 (0)