Revert "rebase: allow starting from a dirty tree."
This reverts commit 6c9ad166db.
Allowing rebase to start in a dirty tree might have been a worthy
goal, but it is not necessarily always wanted (some people prefer
to be reminded that the state is dirty, and think about the next
action that may not be to stash and proceed). Furthermore, depending
on the nature of local changes, unstashing the dirty state on top of
the rebased result is not always desirable.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
# The tree must be clean enough for us to create a stash
stash=$(git stash create) || exit
if test -n "$stash"
then
echo >&2 "Stashed away your working tree changes"
fi
# If a hook exists, give it a chance to interrupt
if test -x "$GIT_DIR/hooks/pre-rebase"
then
"$GIT_DIR/hooks/pre-rebase" ${1+"$@"} || {
echo >&2 "The pre-rebase hook refused to rebase."
test -z "$stash" || git stash apply --index "$stash"
exit 1
}
fi
@ -315,10 +286,7 @@ fi
@@ -315,10 +286,7 @@ fi
case "$#" in
2)
branch_name="$2"
git-checkout "$2" || {
test -z "$stash" || git stash apply --index "$stash"
usage
}
git-checkout "$2" || usage
;;
*)
if branch_name=`git symbolic-ref -q HEAD`
@ -341,7 +309,6 @@ if test "$upstream" = "$onto" && test "$mb" = "$onto" &&
@@ -341,7 +309,6 @@ if test "$upstream" = "$onto" && test "$mb" = "$onto" &&