Add new test case to ensure git-merge prepends the custom merge message
There was no test for this before, so the testsuite passed, even in case the merge summary was missing from the merge commit message. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Miklos Vajna committed
Jun 27, 2008 at 18:22 UTC
c1fb35b98aa36ce789c60520028d95e5f9fee43c
1 file changed
+37
t/t7604-merge-custom-message.sh
new
+37
@@ -0,0 +1,37 @@
1
+#!/bin/sh
2
+
3
+test_description='git-merge
4
+
5
+Testing merge when using a custom message for the merge commit.'
6
+
7
+. ./test-lib.sh
8
+
9
+test_expect_success 'setup' '
10
+ echo c0 > c0.c &&
11
+ git add c0.c &&
12
+ git commit -m c0 &&
13
+ git tag c0 &&
14
+ echo c1 > c1.c &&
15
+ git add c1.c &&
16
+ git commit -m c1 &&
17
+ git tag c1 &&
18
+ git reset --hard c0 &&
19
+ echo c2 > c2.c &&
20
+ git add c2.c &&
21
+ git commit -m c2 &&
22
+ git tag c2
23
+'
24
+
25
+cat >expected <<\EOF
26
+custom message
27
+
28
+Merge commit 'c2'
29
+EOF
30
+test_expect_success 'merge c2 with a custom message' '
31
+ git reset --hard c1 &&
32
+ git merge -m "custom message" c2 &&
33
+ git cat-file commit HEAD | sed -e "1,/^$/d" > actual &&
34
+ test_cmp expected actual
35
+'
36
+
37
+test_done