X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-commit.sh;h=330a434b1891a67f78dfbb665558efef868bb704;hb=6c2711e70cc070559537a44f4975add451ee53f2;hp=c9c22abc5edb3a2d4a22907e1f5b26ca74812859;hpb=b4019f045646b1770a80394da876b8a7c6b8ca7b;p=git.git diff --git a/git-commit.sh b/git-commit.sh index c9c22abc..330a434b 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -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