Skip to content

Commit

Permalink
git-commit --amend: allow empty commit.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Mar 5, 2006
1 parent 1c7fee5 commit 8588452
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8588452

Please sign in to comment.