summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae7c5dc)
raw | patch | inline | side by side (parent: ae7c5dc)
author | Anders Melchiorsen <mail@cup.kalibalik.dk> | |
Tue, 29 Jul 2008 20:12:22 +0000 (22:12 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 30 Jul 2008 07:00:02 +0000 (00:00 -0700) |
This treats aborting a commit more like a feature.
Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-commit.c | patch | blob | history | |
t/t7502-commit.sh | patch | blob | history |
diff --git a/builtin-commit.c b/builtin-commit.c
index 9a11ca0bcd402d9bd4488df6e3526e4a24617b30..f7c053a0106c2e42833d0d7c7255b7b636d09a93 100644 (file)
--- a/builtin-commit.c
+++ b/builtin-commit.c
fprintf(fp,
"\n"
"# Please enter the commit message for your changes.\n"
+ "# To abort the commit, use an empty commit message.\n"
"# (Comment lines starting with '#' will ");
if (cleanup_mode == CLEANUP_ALL)
fprintf(fp, "not be included)\n");
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 4f2682ea800df599d720108ef8f17de06fedc06c..f1112639b698faca38b2c8fc743e422d14dc15f6 100755 (executable)
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
echo "sample
# Please enter the commit message for your changes.
+# To abort the commit, use an empty commit message.
# (Comment lines starting with '#' will not be included)" >expect
test_expect_success 'cleanup commit messages (strip,-F,-e)' '
echo >>negative &&
{ echo;echo sample;echo; } >text &&
git commit -e -F text -a &&
- head -n 4 .git/COMMIT_EDITMSG >actual &&
+ head -n 5 .git/COMMIT_EDITMSG >actual &&
test_cmp expect actual
'
echo >>negative &&
git commit -e -m "sample"
- head -n 7 .git/COMMIT_EDITMSG >actual &&
+ head -n 8 .git/COMMIT_EDITMSG >actual &&
test_cmp expect actual
'
# must fail because there is no change
test_must_fail git commit -e -m "sample"
) &&
- head -n 8 .git/COMMIT_EDITMSG | \
+ head -n 9 .git/COMMIT_EDITMSG | \
sed "s/^# Committer: .*/# Committer:/" >actual &&
test_cmp expect actual
'