summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-02-21 12:45:04 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-02-21 12:45:04 -0800
commit2f6128daab0764c3915dcc9e01c27381b63f5e40 (patch)
tree927fac93c9596bf67ae85e67b0f98ddb47b2d6da /t
parentMerge branch 'lw/daemon-log-destination' (diff)
parentrebase: add --allow-empty-message option (diff)
downloadtgif-2f6128daab0764c3915dcc9e01c27381b63f5e40.tar.xz
Merge branch 'gs/rebase-allow-empty-message'
"git rebase" learned to take "--allow-empty-message" option. * gs/rebase-allow-empty-message: rebase: add --allow-empty-message option
Diffstat (limited to 't')
-rwxr-xr-xt/t3405-rebase-malformed.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t3405-rebase-malformed.sh b/t/t3405-rebase-malformed.sh
index ff8c360cd5..cb7c6de84a 100755
--- a/t/t3405-rebase-malformed.sh
+++ b/t/t3405-rebase-malformed.sh
@@ -3,6 +3,7 @@
test_description='rebase should handle arbitrary git message'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-rebase.sh
cat >F <<\EOF
This is an example of a commit log message
@@ -25,6 +26,7 @@ test_expect_success setup '
test_tick &&
git commit -m "Initial commit" &&
git branch diff-in-message &&
+ git branch empty-message-merge &&
git checkout -b multi-line-subject &&
cat F >file2 &&
@@ -45,6 +47,11 @@ test_expect_success setup '
git cat-file commit HEAD | sed -e "1,/^\$/d" >G0 &&
+ git checkout empty-message-merge &&
+ echo file3 >file3 &&
+ git add file3 &&
+ git commit --allow-empty-message -m "" &&
+
git checkout master &&
echo One >file1 &&
@@ -69,4 +76,20 @@ test_expect_success 'rebase commit with diff in message' '
test_cmp G G0
'
+test_expect_success 'rebase -m commit with empty message' '
+ test_must_fail git rebase -m master empty-message-merge &&
+ git rebase --abort &&
+ git rebase -m --allow-empty-message master empty-message-merge
+'
+
+test_expect_success 'rebase -i commit with empty message' '
+ git checkout diff-in-message &&
+ set_fake_editor &&
+ test_must_fail env FAKE_COMMIT_MESSAGE=" " FAKE_LINES="reword 1" \
+ git rebase -i HEAD^ &&
+ git rebase --abort &&
+ FAKE_COMMIT_MESSAGE=" " FAKE_LINES="reword 1" \
+ git rebase -i --allow-empty-message HEAD^
+'
+
test_done