rebase: give a better error message for bogus branch
[gitweb.git] / git-rebase--interactive.sh
index eb2dff55f81b6726340ce26db93bb161087a4857..20ebd097da66b3562e65a5d4fa45381384ebb70d 100755 (executable)
@@ -626,7 +626,7 @@ skip_unnecessary_picks () {
                case "$fd,$command" in
                3,pick|3,p)
                        # pick a commit whose parent is current $ONTO -> skip
-                       sha1=$(printf '%s' "$rest" | cut -d ' ' -f 1)
+                       sha1=${rest%% *}
                        case "$(git rev-parse --verify --quiet "$sha1"^)" in
                        "$ONTO"*)
                                ONTO=$sha1
@@ -870,7 +870,7 @@ first and then run 'git rebase --continue' again."
 
                if test ! -z "$1"
                then
-                       output git checkout "$1" ||
+                       output git checkout "$1" -- ||
                                die "Could not checkout $1"
                fi