]> git.ipfire.org Git - thirdparty/git.git/commitdiff
diff-highlight: prefer "echo" to "cat" in tests
authorJeff King <peff@peff.net>
Wed, 21 Mar 2018 05:48:53 +0000 (01:48 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Mar 2018 17:24:19 +0000 (10:24 -0700)
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/diff-highlight/t/t9400-diff-highlight.sh

index deab90ed91fd3feaa6b079a722df6354b9263294..3f02d314673de54ca2d1d86dc9b3fbb90730a9ba 100755 (executable)
@@ -68,26 +68,22 @@ test_strip_patch_header () {
 #           D
 #
 dh_test_setup_history () {
-       echo "file1" >file1 &&
-       echo "file2" >file2 &&
-       echo "file3" >file3 &&
-
-       cat file1 >file &&
+       echo file1 >file &&
        git add file &&
        test_tick &&
        git commit -m "D" &&
 
        git checkout -b branch &&
-       cat file2 >file &&
+       echo file2 >file &&
        test_tick &&
        git commit -a -m "E" &&
 
-       cat file3 >file &&
+       echo file3 >file &&
        test_tick &&
        git commit -a -m "F" &&
 
        git checkout master &&
-       cat file2 >file &&
+       echo file2 >file &&
        test_tick &&
        git commit -a -m "A"
 }