X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-commit.sh;h=1e7c09e1f2fdf3b4327c903084bd86616b7956f1;hb=23091e954c968282d4d9087da00f60c2f02aecc5;hp=c9c22abc5edb3a2d4a22907e1f5b26ca74812859;hpb=b4019f045646b1770a80394da876b8a7c6b8ca7b;p=git.git diff --git a/git-commit.sh b/git-commit.sh index c9c22abc..1e7c09e1 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -161,7 +161,7 @@ run_status () { } ' - if test -n "$verbose" + if test -n "$verbose" -a -z "$IS_INITIAL" then git-diff-index --cached -M -p --diff-filter=MDTCRA $REFERENCE fi @@ -595,19 +595,21 @@ then PARENTS=$(git-cat-file commit HEAD | sed -n -e '/^$/q' -e 's/^parent /-p /p') fi + current=$(git-rev-parse --verify HEAD) else if [ -z "$(git-ls-files)" ]; then echo >&2 Nothing to commit exit 1 fi PARENTS="" + current= 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