Skip to content

Commit

Permalink
honor GIT_REFLOG_ACTION in git-commit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Feb 3, 2007
1 parent 5f856dd commit 23913dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ else
rloga='commit (initial)'
current=''
fi
set_reflog_action "$rloga"

if test -z "$no_edit"
then
Expand Down Expand Up @@ -602,7 +603,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
Expand Down
2 changes: 2 additions & 0 deletions git-revert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ do
shift
done

set_reflog_action "$me"

test "$me,$replay" = "revert,t" && usage

case "$no_commit" in
Expand Down

0 comments on commit 23913dc

Please sign in to comment.