X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft7500-commit.sh;h=aa9c577e9e306bce05cd0fe076c56017c1b97e41;hb=48c250a121a425a1860226b6a7061aecfbab5246;hp=5998baf27b5ad0fb32bf0fd42023d029a65d0e6b;hpb=891182f9141326fd6833d3651b89860a0b41f153;p=git.git diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh index 5998baf27..aa9c577e9 100755 --- a/t/t7500-commit.sh +++ b/t/t7500-commit.sh @@ -150,7 +150,7 @@ EOF test_expect_success '--signoff' ' echo "yet another content *narf*" >> foo && echo "zort" | git commit -s -F - foo && - git cat-file commit HEAD | sed "1,/^$/d" > output && + git cat-file commit HEAD | sed "1,/^\$/d" > output && test_cmp expect output ' @@ -183,4 +183,36 @@ test_expect_success 'commit message from stdin' ' commit_msg_is "Log with foo word" ' +test_expect_success 'commit -F overrides -t' ' + ( + cd subdir && + echo "-F log" > f.log && + echo "-t template" > t.template && + git commit --allow-empty -F f.log -t t.template + ) && + 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 >foo && + git add foo && + >empty && + test_must_fail git commit >foo && + git add foo && + git commit --allow-empty-message -m"hello there" && + commit_msg_is "hello there" +' + test_done