t7604: clean up style
Before, we had some Git commands which were upstream of the pipe. This meant that if it produced an error, it would've gone unnoticed. Refactor to place Git commands on their own. Also, while we're at it, remove spaces after redirection operators. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Helped-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu committed
Apr 17, 2019 at 11:23 UTC
b720e1e3c3156a46ad1c4f5bbe13c7aeefb25c29
1 file changed
+7
-5
t/t7604-merge-custom-message.sh
+7
-5
@@ -16,16 +16,16 @@ create_merge_msgs() {
16
}
17
18
test_expect_success 'setup' '
19
- echo c0 > c0.c &&
19
+ echo c0 >c0.c &&
20
git add c0.c &&
21
git commit -m c0 &&
22
git tag c0 &&
23
- echo c1 > c1.c &&
23
+ echo c1 >c1.c &&
24
git add c1.c &&
25
git commit -m c1 &&
26
git tag c1 &&
27
git reset --hard c0 &&
28
- echo c2 > c2.c &&
28
+ echo c2 >c2.c &&
29
git add c2.c &&
30
git commit -m c2 &&
31
git tag c2 &&
@@ -36,14 +36,16 @@ test_expect_success 'setup' '
36
test_expect_success 'merge c2 with a custom message' '
37
git reset --hard c1 &&
38
git merge -m "$(cat exp.subject)" c2 &&
39
- git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
39
+ git cat-file commit HEAD >raw &&
40
+ sed -e "1,/^$/d" raw >actual &&
41
test_cmp exp.subject actual
42
'
43
44
test_expect_success 'merge --log appends to custom message' '
45
git reset --hard c1 &&
46
git merge --log -m "$(cat exp.subject)" c2 &&
46
- git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
47
+ git cat-file commit HEAD >raw &&
48
+ sed -e "1,/^$/d" raw >actual &&
49
test_cmp exp.log actual
50
'
51