@matheusbsbs / matheus-bagliano / commits / 8588452ceb
Fork 0

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>

Junio C Hamano committed Mar 4, 2006 at 20:36 UTC 8588452ceb78b1da17652ba03f9942ef740e07ea
1 file changed +1 -1
git-commit.sh
+1 -1
@@ -609,7 +609,7 @@ fi
609 test -z "$only_include_assumed" || echo "$only_include_assumed"
610 run_status
611 } >>"$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" ]
613 then
614 rm -f "$GIT_DIR/COMMIT_EDITMSG"
615 run_status