Skip to content

Commit

Permalink
rebase -i: Handle the author script all in one place in do_next
Browse files Browse the repository at this point in the history
This change has no practical effect but makes the code easier to
follow.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Jan 14, 2010
1 parent ee0a4af commit 5c5d059
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ do_next () {
make_squash_message $squash_style $sha1 > "$MSG"
failed=f
author_script=$(get_author_ident_from_commit HEAD)
echo "$author_script" > "$AUTHOR_SCRIPT"
eval "$author_script"
output git reset --soft HEAD^
pick_one -n $sha1 || failed=t
case "$(peek_next_command)" in
Expand All @@ -465,11 +467,9 @@ do_next () {
rm -f "$GIT_DIR"/MERGE_MSG || exit
;;
esac
echo "$author_script" > "$AUTHOR_SCRIPT"
if test $failed = f
then
# This is like --amend, but with a different message
eval "$author_script"
GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
Expand Down

0 comments on commit 5c5d059

Please sign in to comment.