aboutsummaryrefslogtreecommitdiff
path: root/t/t7600-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-03 13:18:20 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-03 13:18:20 -0700
commitec845695c4e6d7b689c3eb0b53d1b2ba4803c7ea (patch)
treeb02046a790e4a291d96042ea308841926c61c937 /t/t7600-merge.sh
parente4b9c36ca40a0869ee5fc64aaeabaf2655ef595b (diff)
parentefb779f8873e5aa36be29a4e551186c62c1b580c (diff)
downloadgit-ec845695c4e6d7b689c3eb0b53d1b2ba4803c7ea.tar.gz
git-ec845695c4e6d7b689c3eb0b53d1b2ba4803c7ea.tar.xz
Merge commit 'sg/merge-options^' into jk/renamelimit
* commit 'sg/merge-options^': merge, pull: add '--(no-)log' command line option fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable add 'merge.stat' config variable merge, pull: introduce '--(no-)stat' option doc: moved merge.* config variables into separate merge-config.txt
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-xt/t7600-merge.sh39
1 files changed, 34 insertions, 5 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 56869acee..d21cd290d 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -104,7 +104,11 @@ create_merge_msgs() {
git log --no-merges ^HEAD c2 >>squash.1-5 &&
echo "Squashed commit of the following:" >squash.1-5-9 &&
echo >>squash.1-5-9 &&
- git log --no-merges ^HEAD c2 c3 >>squash.1-5-9
+ git log --no-merges ^HEAD c2 c3 >>squash.1-5-9 &&
+ echo > msg.nolog &&
+ echo "* commit 'c3':" >msg.log &&
+ echo " commit 3" >>msg.log &&
+ echo >>msg.log
}
verify_diff() {
@@ -364,7 +368,7 @@ test_expect_success 'merge c1 with c2 (squash in config)' '
test_debug 'gitk --all'
-test_expect_success 'override config option -n' '
+test_expect_success 'override config option -n with --summary' '
git reset --hard c1 &&
git config branch.master.mergeoptions "-n" &&
test_tick &&
@@ -373,15 +377,30 @@ test_expect_success 'override config option -n' '
verify_parents $c1 $c2 &&
if ! grep "^ file | *2 +-$" diffstat.txt
then
- echo "[OOPS] diffstat was not generated"
+ echo "[OOPS] diffstat was not generated with --summary"
+ false
+ fi
+'
+
+test_expect_success 'override config option -n with --stat' '
+ git reset --hard c1 &&
+ git config branch.master.mergeoptions "-n" &&
+ test_tick &&
+ git merge --stat c2 >diffstat.txt &&
+ verify_merge file result.1-5 msg.1-5 &&
+ verify_parents $c1 $c2 &&
+ if ! grep "^ file | *2 +-$" diffstat.txt
+ then
+ echo "[OOPS] diffstat was not generated with --stat"
+ false
fi
'
test_debug 'gitk --all'
-test_expect_success 'override config option --summary' '
+test_expect_success 'override config option --stat' '
git reset --hard c1 &&
- git config branch.master.mergeoptions "--summary" &&
+ git config branch.master.mergeoptions "--stat" &&
test_tick &&
git merge -n c2 >diffstat.txt &&
verify_merge file result.1-5 msg.1-5 &&
@@ -441,6 +460,16 @@ test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
verify_head $c1
'
+test_expect_success 'merge log message' '
+ git reset --hard c0 &&
+ git merge --no-log c2 &&
+ git show -s --pretty=format:%b HEAD >msg.act &&
+ verify_diff msg.nolog msg.act "[OOPS] bad merge log message" &&
+ git merge --log c3 &&
+ git show -s --pretty=format:%b HEAD >msg.act &&
+ verify_diff msg.log msg.act "[OOPS] bad merge log message"
+'
+
test_debug 'gitk --all'
test_done