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
This commit is contained in:
Junio C Hamano
2018-02-21 12:45:04 -08:00
7 changed files with 53 additions and 11 deletions

View File

@ -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