honor GIT_REFLOG_ACTION in git-commit

This allows git-cherry-pick and git-revert to properly identify
themselves in the resulting reflog entries.  Earlier they were
recorded as what git-commit has done.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2007-01-19 17:12:11 -08:00
parent 5f856dd47d
commit 23913dc713
2 changed files with 4 additions and 1 deletions

View File

@ -528,6 +528,7 @@ else
rloga='commit (initial)' rloga='commit (initial)'
current='' current=''
fi fi
set_reflog_action "$rloga"
if test -z "$no_edit" if test -z "$no_edit"
then then
@ -602,7 +603,7 @@ then
fi && fi &&
commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) && commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) &&
rlogm=$(sed -e 1q "$GIT_DIR"/COMMIT_MSG) && 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" && rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" &&
if test -f "$NEXT_INDEX" if test -f "$NEXT_INDEX"
then then

View File

@ -54,6 +54,8 @@ do
shift shift
done done
set_reflog_action "$me"
test "$me,$replay" = "revert,t" && usage test "$me,$replay" = "revert,t" && usage
case "$no_commit" in case "$no_commit" in