Skip to content

Commit 8588452

Browse files
author
Junio C Hamano
committed
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>
1 parent 1c7fee5 commit 8588452

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ fi
609609
test -z "$only_include_assumed" || echo "$only_include_assumed"
610610
run_status
611611
} >>"$GIT_DIR"/COMMIT_EDITMSG
612-
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ]
612+
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
613613
then
614614
rm -f "$GIT_DIR/COMMIT_EDITMSG"
615615
run_status

0 commit comments

Comments
 (0)