diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-06-22 08:31:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-06-22 08:31:25 -0700 |
commit | e3ed7f721c7bd4ecb5c98a29761ff2b2e6d38336 (patch) | |
tree | 4ad2c30d66103b9eceba7da7c5ea57ff8a9bf2c7 /t | |
parent | 958ff4a5973c9858c36c405c2f593cf5172e5e1c (diff) | |
parent | f0ecac2b70bf6b44b89dfa493abd2f544010b1eb (diff) | |
download | git-e3ed7f721c7bd4ecb5c98a29761ff2b2e6d38336.tar.gz |
Merge branch 'tc/merge-m-log' into maint
* tc/merge-m-log:
merge: --log appends shortlog to message if specified
fmt-merge-msg: add function to append shortlog only
fmt-merge-msg: refactor merge title formatting
fmt-merge-msg: minor refactor of fmt_merge_msg()
merge: rename variable
merge: update comment
t7604-merge-custom-message: show that --log doesn't append to -m
t7604-merge-custom-message: shift expected output creation
Diffstat (limited to 't')
-rwxr-xr-x | t/t7604-merge-custom-message.sh | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/t/t7604-merge-custom-message.sh b/t/t7604-merge-custom-message.sh index 269cfdf267..9114785ef7 100755 --- a/t/t7604-merge-custom-message.sh +++ b/t/t7604-merge-custom-message.sh @@ -6,6 +6,15 @@ Testing merge when using a custom message for the merge commit.' . ./test-lib.sh +create_merge_msgs() { + echo >exp.subject "custom message" + + cp exp.subject exp.log && + echo >>exp.log "" && + echo >>exp.log "* commit 'c2':" && + echo >>exp.log " c2" +} + test_expect_success 'setup' ' echo c0 > c0.c && git add c0.c && @@ -19,16 +28,23 @@ test_expect_success 'setup' ' echo c2 > c2.c && git add c2.c && git commit -m c2 && - git tag c2 + git tag c2 && + create_merge_msgs ' test_expect_success 'merge c2 with a custom message' ' git reset --hard c1 && - echo >expected "custom message" && - git merge -m "custom message" c2 && + git merge -m "$(cat exp.subject)" c2 && + git cat-file commit HEAD | sed -e "1,/^$/d" >actual && + test_cmp exp.subject actual +' + +test_expect_success 'merge --log appends to custom message' ' + git reset --hard c1 && + git merge --log -m "$(cat exp.subject)" c2 && git cat-file commit HEAD | sed -e "1,/^$/d" >actual && - test_cmp expected actual + test_cmp exp.log actual ' test_done |