rebase: give a better error message for bogus branch
[gitweb.git] / git-rebase.sh
index 6a7e5e0b1884358566544cc8cd0d94c941dac5fc..26d5197a0fb627eb6991910c229eacbf9b190638 100755 (executable)
@@ -491,6 +491,7 @@ case "$#" in
        then
                head_name="detached HEAD"
        else
+               echo >&2 "fatal: no such branch: $1"
                usage
        fi
        ;;
@@ -522,7 +523,7 @@ then
        if test -z "$force_rebase"
        then
                # Lazily switch to the target branch if needed...
-               test -z "$switch_to" || git checkout "$switch_to"
+               test -z "$switch_to" || git checkout "$switch_to" --
                say "Current branch $branch_name is up to date."
                exit 0
        else