Merge branch 'kf/askpass-config'
[gitweb.git] / t / t6200-fmt-merge-msg.sh
index 5553dff55a0a0319ec3d36b6259483077ecb1daa..71f6cad3c2b8e8ed0b16d292f4922760901702ef 100755 (executable)
@@ -129,6 +129,38 @@ test_expect_success '[merge] summary/log configuration' '
        test_cmp expected actual2
 '
 
+test_expect_success 'fmt-merge-msg -m' '
+       echo "Sync with left" >expected &&
+       cat >expected.log <<-EOF &&
+       Sync with left
+
+       * ${apos}left${apos} of $(pwd):
+         Left #5
+         Left #4
+         Left #3
+         Common #2
+         Common #1
+       EOF
+
+       test_might_fail git config --unset merge.log &&
+       test_might_fail git config --unset merge.summary &&
+       git checkout master &&
+       git fetch "$(pwd)" left &&
+       git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
+       git fmt-merge-msg --log -m "Sync with left" \
+                                       <.git/FETCH_HEAD >actual.log &&
+       git config merge.log true &&
+       git fmt-merge-msg -m "Sync with left" \
+                                       <.git/FETCH_HEAD >actual.log-config &&
+       git fmt-merge-msg --no-log -m "Sync with left" \
+                                       <.git/FETCH_HEAD >actual.nolog &&
+
+       test_cmp expected actual &&
+       test_cmp expected.log actual.log &&
+       test_cmp expected.log actual.log-config &&
+       test_cmp expected actual.nolog
+'
+
 test_expect_success 'setup: expected shortlog for two branches' '
        cat >expected <<-EOF
        Merge branches ${apos}left${apos} and ${apos}right${apos}