summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3889b8)
raw | patch | inline | side by side (parent: f3889b8)
author | Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> | |
Sun, 6 Feb 2011 18:43:41 +0000 (13:43 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 10 Feb 2011 22:08:08 +0000 (14:08 -0800) |
Reorder validation steps in preparation for the validation to be factored
out from git-rebase--interactive.sh into git-rebase.sh.
The main functional difference is that the pre-rebase hook will no longer
be run if the work tree is dirty.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
out from git-rebase--interactive.sh into git-rebase.sh.
The main functional difference is that the pre-rebase hook will no longer
be run if the work tree is dirty.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--interactive.sh | patch | blob | history | |
git-rebase.sh | patch | blob | history |
index 4f4fb29a49f1b3440cb60fca68f4ad91916522b0..0f04f36eba091653f53511acd4c6d978d074c5c6 100755 (executable)
test -z "$onto" &&
die "You must specify --onto when using --root"
fi
+require_clean_work_tree "rebase" "Please commit or stash them."
+
run_pre_rebase_hook "$upstream_arg" "$@"
comment_for_reflog start
-require_clean_work_tree "rebase" "Please commit or stash them."
-
if test ! -z "$1"
then
output git checkout "$1" -- ||
diff --git a/git-rebase.sh b/git-rebase.sh
index aa1bcaf07f61f70dc650667dd73c295b5207dcfc..4a83d1042672184fcdcefbac1d99a9bfb46160f2 100755 (executable)
--- a/git-rebase.sh
+++ b/git-rebase.sh
test "$type" = interactive && run_interactive_rebase "$@"
-require_clean_work_tree "rebase" "Please commit or stash them."
-
if test -z "$rebase_root"
then
# The upstream head must be given. Make sure it is valid.
;;
esac
-# If a hook exists, give it a chance to interrupt
-run_pre_rebase_hook "$upstream_arg" "$@"
-
# If the branch to rebase is given, that is the branch we will rebase
# $branch_name -- branch being rebased, or HEAD (already detached)
# $orig_head -- commit object name of tip of the branch before rebasing
esac
orig_head=$branch
+require_clean_work_tree "rebase" "Please commit or stash them."
+
# Now we are rebasing commits $upstream..$branch (or with --root,
# everything leading up to $branch) on top of $onto
fi
fi
+# If a hook exists, give it a chance to interrupt
+run_pre_rebase_hook "$upstream_arg" "$@"
+
# Detach HEAD and reset the tree
say "First, rewinding head to replay your work on top of it..."
git checkout -q "$onto^0" || die "could not detach HEAD"