From 8588452ceb78b1da17652ba03f9942ef740e07ea Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 4 Mar 2006 20:36:28 -0800 Subject: 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 --- git-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-commit.sh') diff --git a/git-commit.sh b/git-commit.sh index d9ec1f14d..330a434b1 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 -- cgit v1.2.1