summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-03-21 05:48:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-21 17:24:19 (GMT)
commite28ae5072f633d77c65817db7b3aeb07d531a8d9 (patch)
tree62486310126b9da5258428343176b350bd6e6526
parent53ab9f0e3d0ff2bb5803059da3526ef6eda8ce65 (diff)
downloadgit-e28ae5072f633d77c65817db7b3aeb07d531a8d9.zip
git-e28ae5072f633d77c65817db7b3aeb07d531a8d9.tar.gz
git-e28ae5072f633d77c65817db7b3aeb07d531a8d9.tar.bz2
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>
-rwxr-xr-xcontrib/diff-highlight/t/t9400-diff-highlight.sh12
1 files changed, 4 insertions, 8 deletions
diff --git a/contrib/diff-highlight/t/t9400-diff-highlight.sh b/contrib/diff-highlight/t/t9400-diff-highlight.sh
index deab90e..3f02d31 100755
--- a/contrib/diff-highlight/t/t9400-diff-highlight.sh
+++ b/contrib/diff-highlight/t/t9400-diff-highlight.sh
@@ -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"
}