Merge branch 'jc/maint-branch-mergeoptions'
[git.git] / t / t7600-merge.sh
index b7cac228fd610652aba1bcba08bcf15f03c9d714..a07caa8eaec1cd148f68d7190880fbe537a14162 100755 (executable)
@@ -323,6 +323,38 @@ test_expect_success 'merge c1 with c2 (no-commit in config)' '
 
 test_debug 'git log --graph --decorate --oneline --all'
 
+test_expect_success 'merge c1 with c2 (log in config)' '
+       git config branch.master.mergeoptions "" &&
+       git reset --hard c1 &&
+       git merge --log c2 &&
+       git show -s --pretty=tformat:%s%n%b >expect &&
+
+       git config branch.master.mergeoptions --log &&
+       git reset --hard c1 &&
+       git merge c2 &&
+       git show -s --pretty=tformat:%s%n%b >actual &&
+
+       test_cmp expect actual
+'
+
+test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
+       (
+               git config --remove-section branch.master
+               git config --remove-section merge
+       )
+       git reset --hard c1 &&
+       git merge c2 &&
+       git show -s --pretty=tformat:%s%n%b >expect &&
+
+       git config branch.master.mergeoptions "--no-log" &&
+       git config merge.log true &&
+       git reset --hard c1 &&
+       git merge c2 &&
+       git show -s --pretty=tformat:%s%n%b >actual &&
+
+       test_cmp expect actual
+'
+
 test_expect_success 'merge c1 with c2 (squash in config)' '
        git reset --hard c1 &&
        git config branch.master.mergeoptions "--squash" &&