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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Mar 21, 2018 at 01:48 UTC
e28ae5072f633d77c65817db7b3aeb07d531a8d9
1 file changed
+4
-8
contrib/diff-highlight/t/t9400-diff-highlight.sh
+4
-8
@@ -68,26 +68,22 @@ test_strip_patch_header () {
68
# D
69
#
70
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 &&
72
git add file &&
73
test_tick &&
74
git commit -m "D" &&
75
76
git checkout -b branch &&
81
- cat file2 >file &&
77
+ echo file2 >file &&
78
test_tick &&
79
git commit -a -m "E" &&
80
85
- cat file3 >file &&
81
+ echo file3 >file &&
82
test_tick &&
83
git commit -a -m "F" &&
84
85
git checkout master &&
90
- cat file2 >file &&
86
+ echo file2 >file &&
87
test_tick &&
88
git commit -a -m "A"
89
}