summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-27 21:38:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-27 21:38:07 (GMT)
commitee1a1ddf38a791e6464a71814de0b74c57098eb2 (patch)
treedaf5cfe2bc5c1ab9b5fccd6102913bf4be0bafda /t
parent872f5bfb08b16057fdc02bb758abedcc6e4379ca (diff)
parent25206778aac776fc6cc4887653fdae476c7a9b5a (diff)
downloadgit-ee1a1ddf38a791e6464a71814de0b74c57098eb2.zip
git-ee1a1ddf38a791e6464a71814de0b74c57098eb2.tar.gz
git-ee1a1ddf38a791e6464a71814de0b74c57098eb2.tar.bz2
Merge branch 'rs/commit-m-no-edit' into maint
* rs/commit-m-no-edit: commit: don't start editor if empty message is given with -m
Diffstat (limited to 't')
-rwxr-xr-xt/t7502-commit.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index a4938b1..6313da2 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 &&