[PATCH v3 1/4] rebase -i: execute hook only after argument checking
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Jan 2, 2009, 22:28 UTC
- Message-ID
- <6a754e4198413c4051a6085c5e5baab163835463.1230935095.git.trast@student.ethz.ch>
- In-Reply-To
- <200901022320.14055.trast@student.ethz.ch>
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> ---
This is a quick fix and not really part of the series. 2/4 textually depends on it, however, so I'm sending it along.
git-rebase--interactive.sh | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index c8b0861..2c668cd 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -554,7 +554,6 @@ 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" @@ -562,11 +561,13 @@ first and then run 'git rebase --continue' again." 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"
-- 1.6.1.71.gaaa47.dirty