summaryrefslogtreecommitdiff
path: root/git-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-05 04:36:28 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-05 08:57:01 (GMT)
commit8588452ceb78b1da17652ba03f9942ef740e07ea (patch)
treed94d5ceebbdf05a5e98923a00bbed41c0f676378 /git-commit.sh
parent1c7fee5d0857d809fe5d93a1d56968e44296ce55 (diff)
downloadgit-8588452ceb78b1da17652ba03f9942ef740e07ea.zip
git-8588452ceb78b1da17652ba03f9942ef740e07ea.tar.gz
git-8588452ceb78b1da17652ba03f9942ef740e07ea.tar.bz2
git-commit --amend: allow empty commit.
When amending a commit only to update the commit log message, git-status would rightly say "Nothing to commit." Do not let this prevent commit to be made. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-commit.sh')
-rwxr-xr-xgit-commit.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-commit.sh b/git-commit.sh
index d9ec1f1..330a434 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -609,7 +609,7 @@ fi
test -z "$only_include_assumed" || echo "$only_include_assumed"
run_status
} >>"$GIT_DIR"/COMMIT_EDITMSG
-if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ]
+if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
then
rm -f "$GIT_DIR/COMMIT_EDITMSG"
run_status