X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-commit.sh;h=cad16a5e868730dd56f79baf711aed138d7cafe1;hb=fd2a75972e90d34bc8d4bebe1d669645557a2192;hp=dc0fc3b679c78f2a1884658d556cc888a6d3e441;hpb=76db9dec8132d4377f6c32e4d45eb75fa0cc7a9a;p=git.git diff --git a/git-commit.sh b/git-commit.sh index dc0fc3b67..cad16a5e8 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -318,6 +318,10 @@ esac case "$all,$also" in t,) + if test ! -f "$THIS_INDEX" + then + die 'nothing to commit (use "git add file1 file2" to include for commit)' + fi save_index && ( cd_to_toplevel && @@ -528,6 +532,7 @@ else rloga='commit (initial)' current='' fi +set_reflog_action "$rloga" if test -z "$no_edit" then @@ -602,7 +607,7 @@ then fi && commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) && rlogm=$(sed -e 1q "$GIT_DIR"/COMMIT_MSG) && - git-update-ref -m "$rloga: $rlogm" HEAD $commit "$current" && + git-update-ref -m "$GIT_REFLOG_ACTION: $rlogm" HEAD $commit "$current" && rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" && if test -f "$NEXT_INDEX" then @@ -616,6 +621,9 @@ else fi ret="$?" rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG" + +cd_to_toplevel + if test -d "$GIT_DIR/rr-cache" then git-rerere