3 # Copyright (c) 2006, Junio C Hamano
6 test_description
='fmt-merge-msg test'
12 GIT_COMMITTER_DATE
="$datestamp +0200"
13 GIT_AUTHOR_DATE
="$datestamp +0200"
14 datestamp
=`expr "$datestamp" + 1`
15 export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
18 test_expect_success setup
'
22 git commit -m "Initial" &&
28 git commit -a -m "Second" &&
30 git checkout -b left &&
32 echo $datestamp >one &&
34 git commit -a -m "Common #1" &&
36 echo $datestamp >one &&
38 git commit -a -m "Common #2" &&
42 echo $datestamp >two &&
44 git commit -a -m "Left #3" &&
46 echo $datestamp >two &&
48 git commit -a -m "Left #4" &&
50 echo $datestamp >two &&
52 git commit -a -m "Left #5" &&
56 echo $datestamp >three &&
59 git commit -a -m "Right #3" &&
61 echo $datestamp >three &&
63 git commit -a -m "Right #4" &&
65 echo $datestamp >three &&
67 git commit -a -m "Right #5" &&
76 test_expect_success
'merge-msg test #1' '
78 git checkout master &&
81 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
82 diff -u actual expected
86 Merge branch
'left' of ..
/trash
89 test_expect_success
'merge-msg test #2' '
91 git checkout master &&
92 git fetch ../trash left &&
94 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
95 diff -u actual expected
109 test_expect_success
'merge-msg test #3' '
111 git config merge.summary true &&
113 git checkout master &&
117 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
118 diff -u actual expected
122 Merge branches
'left' and
'right'
139 test_expect_success
'merge-msg test #4' '
141 git config merge.summary true &&
143 git checkout master &&
145 git fetch . left right &&
147 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
148 diff -u actual expected
151 test_expect_success
'merge-msg test #5' '
153 git config merge.summary yes &&
155 git checkout master &&
157 git fetch . left right &&
159 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
160 diff -u actual expected