diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-05 14:59:53 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-05 14:59:53 -0700 |
commit | bf9923171e299fec694153c68f06bfc1650e412d (patch) | |
tree | 53a5e9cccc3a735764d83e46555c9f2cd2d7e233 /t/t7502-commit.sh | |
parent | 54b9b58a8c54533e7752dd1354ec313fa20138eb (diff) | |
parent | 25206778aac776fc6cc4887653fdae476c7a9b5a (diff) | |
download | git-bf9923171e299fec694153c68f06bfc1650e412d.tar.gz |
Merge branch 'rs/commit-m-no-edit'
"git commit --allow-empty-message -m ''" should not start an
editor.
* rs/commit-m-no-edit:
commit: don't start editor if empty message is given with -m
Diffstat (limited to 't/t7502-commit.sh')
-rwxr-xr-x | t/t7502-commit.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh index a4938b1e45..6313da2cdd 100755 --- a/t/t7502-commit.sh +++ b/t/t7502-commit.sh @@ -361,6 +361,23 @@ test_expect_success !AUTOIDENT 'do not fire editor when committer is bogus' ' test_cmp expect .git/result ' +test_expect_success 'do not fire editor if -m <msg> was given' ' + echo tick >file && + git add file && + echo "editor not started" >.git/result && + (GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" git commit -m tick) && + test "$(cat .git/result)" = "editor not started" +' + +test_expect_success 'do not fire editor if -m "" was given' ' + echo tock >file && + git add file && + echo "editor not started" >.git/result && + (GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" \ + git commit -m "" --allow-empty-message) && + test "$(cat .git/result)" = "editor not started" +' + test_expect_success 'do not fire editor in the presence of conflicts' ' git clean -f && |