Skip to content

Commit

Permalink
rebase -i: execute hook only after argument checking
Browse files Browse the repository at this point in the history
Previously, the pre-rebase-hook would be launched before we knew if
the <upstream> [<branch>] arguments were supplied.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Jan 3, 2009
1 parent 8104ebf commit d8fab02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -554,19 +554,20 @@ first and then run 'git rebase --continue' again."
;;
--)
shift
run_pre_rebase_hook ${1+"$@"}
test $# -eq 1 -o $# -eq 2 || usage
test -d "$DOTEST" &&
die "Interactive rebase already started"

git var GIT_COMMITTER_IDENT >/dev/null ||
die "You need to set your committer info first"

UPSTREAM=$(git rev-parse --verify "$1") || die "Invalid base"
run_pre_rebase_hook ${1+"$@"}

comment_for_reflog start

require_clean_work_tree

UPSTREAM=$(git rev-parse --verify "$1") || die "Invalid base"
test -z "$ONTO" && ONTO=$UPSTREAM

if test ! -z "$2"
Expand Down

0 comments on commit d8fab02

Please sign in to comment.