@@ -36,14 +36,18 @@ test_expect_success 'setup' '
test_expect_success 'merge c2 with a custom message' '
git reset --hard c1 &&
git merge -m "$(cat exp.subject)" c2 &&
- git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
+ git cat-file commit HEAD >actual &&
+ sed -e "1,/^$/d" <actual >tmp &&
+ mv tmp actual &&
test_cmp exp.subject actual
'
test_expect_success 'merge --log appends to custom message' '
git reset --hard c1 &&
git merge --log -m "$(cat exp.subject)" c2 &&
- git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
+ git cat-file commit HEAD >actual &&
+ sed -e "1,/^$/d" <actual >tmp &&
+ mv tmp actual &&
test_cmp exp.log actual
'
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. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Denton Liu <liu.denton@gmail.com> --- t/t7604-merge-custom-message.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)