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>
This commit is contained in:
Junio C Hamano 2006-03-04 20:36:28 -08:00
parent 1c7fee5d08
commit 8588452ceb

View File

@ -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