Skip to content

Commit b720e1e

Browse files
Denton-Lgitster
authored andcommitted
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 <[email protected]> Helped-by: SZEDER Gábor <[email protected]> Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5caab8d commit b720e1e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

t/t7604-merge-custom-message.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ create_merge_msgs() {
1616
}
1717

1818
test_expect_success 'setup' '
19-
echo c0 > c0.c &&
19+
echo c0 >c0.c &&
2020
git add c0.c &&
2121
git commit -m c0 &&
2222
git tag c0 &&
23-
echo c1 > c1.c &&
23+
echo c1 >c1.c &&
2424
git add c1.c &&
2525
git commit -m c1 &&
2626
git tag c1 &&
2727
git reset --hard c0 &&
28-
echo c2 > c2.c &&
28+
echo c2 >c2.c &&
2929
git add c2.c &&
3030
git commit -m c2 &&
3131
git tag c2 &&
@@ -36,14 +36,16 @@ test_expect_success 'setup' '
3636
test_expect_success 'merge c2 with a custom message' '
3737
git reset --hard c1 &&
3838
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 &&
4041
test_cmp exp.subject actual
4142
'
4243

4344
test_expect_success 'merge --log appends to custom message' '
4445
git reset --hard c1 &&
4546
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 &&
4749
test_cmp exp.log actual
4850
'
4951

0 commit comments

Comments
 (0)