diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2010-04-06 12:40:35 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-04-08 02:22:57 +0400 |
commit | c9b5fde7593ac88b1c475bea51d21ba1a1d57d65 (patch) | |
tree | 51f4e4875024f41429762f2bf5fd6d8108e0ec9d /t/t7500-commit.sh | |
parent | 537f6c7fb40257776a513128043112ea43b5cdb8 (diff) |
Add option to git-commit to allow empty log messages
Change git-commit(1) to accept the --allow-empty-message option
to allow a commit with an empty message. This is analogous to the
existing --allow-empty option which allows a commit that records
no changes. As these are mainly for interoperating with foreign SCM
systems, and are not meant for normal use, ensure that "git commit -h"
does not talk about them.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7500-commit.sh')
-rwxr-xr-x | t/t7500-commit.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh index 9f5c3edb03..aa9c577e9e 100755 --- a/t/t7500-commit.sh +++ b/t/t7500-commit.sh @@ -193,4 +193,26 @@ test_expect_success 'commit -F overrides -t' ' commit_msg_is "-F log" ' +test_expect_success 'Commit without message is allowed with --allow-empty-message' ' + echo "more content" >>foo && + git add foo && + >empty && + git commit --allow-empty-message <empty && + commit_msg_is "" +' + +test_expect_success 'Commit without message is no-no without --allow-empty-message' ' + echo "more content" >>foo && + git add foo && + >empty && + test_must_fail git commit <empty +' + +test_expect_success 'Commit a message with --allow-empty-message' ' + echo "even more content" >>foo && + git add foo && + git commit --allow-empty-message -m"hello there" && + commit_msg_is "hello there" +' + test_done |