rebase -i: execute hook only after argument checking
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>
Thomas Rast committed
Jan 2, 2009 at 23:28 UTC
d8fab0234d6db440a71f38f8538dbdefbbdfd077
1 file changed
+3
-2
git-rebase--interactive.sh
+3
-2
@@ -554,7 +554,6 @@ first and then run 'git rebase --continue' again."
554
;;
555
--)
556
shift
557
- run_pre_rebase_hook ${1+"$@"}
557
test $# -eq 1 -o $# -eq 2 || usage
558
test -d "$DOTEST" &&
559
die "Interactive rebase already started"
@@ -562,11 +561,13 @@ first and then run 'git rebase --continue' again."
561
git var GIT_COMMITTER_IDENT >/dev/null ||
562
die "You need to set your committer info first"
563
564
+ UPSTREAM=$(git rev-parse --verify "$1") || die "Invalid base"
565
+ run_pre_rebase_hook ${1+"$@"}
566
+
567
comment_for_reflog start
568
569
require_clean_work_tree
570
569
- UPSTREAM=$(git rev-parse --verify "$1") || die "Invalid base"
571
test -z "$ONTO" && ONTO=$UPSTREAM
572
573
if test ! -z "$2"