]> granicus.if.org Git - git/commitdiff
rebase: use peel_committish() where appropriate
authorRamkumar Ramachandra <artagnon@gmail.com>
Fri, 14 Jun 2013 13:17:52 +0000 (18:47 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Jun 2013 16:41:18 +0000 (09:41 -0700)
The revisions specified on the command-line as <onto> and <upstream>
arguments could be of the form :/quuxery; so, use peel_committish() to
resolve them.  The failing tests in t/rebase and t/rebase-interactive
now pass.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase.sh
t/t3400-rebase.sh
t/t3404-rebase-interactive.sh

index d0c11a910a69603ac19c83a5d29af9f32f780267..6987b9b6db0b81ff4fa0ab8981c690c9a3765612 100755 (executable)
@@ -434,7 +434,7 @@ then
                shift
                ;;
        esac
-       upstream=`git rev-parse --verify "${upstream_name}^0"` ||
+       upstream=$(peel_committish "${upstream_name}") ||
        die "$(eval_gettext "invalid upstream \$upstream_name")"
        upstream_arg="$upstream_name"
 else
@@ -470,7 +470,7 @@ case "$onto_name" in
        fi
        ;;
 *)
-       onto=$(git rev-parse --verify "${onto_name}^0") ||
+       onto=$(peel_committish "$onto_name") ||
        die "$(eval_gettext "Does not point to a valid commit: \$onto_name")"
        ;;
 esac
index 81ec5176294083135abd5d7e03f3a213ce7da497..cbca71ed56bd4443cbfc1f4842eb589b6beeae16 100755 (executable)
@@ -88,7 +88,7 @@ test_expect_success 'rebase fast-forward to master' '
        test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out
 '
 
-test_expect_failure 'rebase, with <onto> and <upstream> specified as :/quuxery' '
+test_expect_success 'rebase, with <onto> and <upstream> specified as :/quuxery' '
        test_when_finished "git branch -D torebase" &&
        git checkout -b torebase my-topic-branch^ &&
        upstream=$(git rev-parse ":/Add B") &&
index eb241f531273819ef9e62f20fdbe4811996a3fc6..86917d172f78ca4b5edd5dfe1334d1f1100fe36b 100755 (executable)
@@ -947,7 +947,7 @@ test_expect_success 'rebase -i respects core.commentchar' '
        test B = $(git cat-file commit HEAD^ | sed -ne \$p)
 '
 
-test_expect_failure 'rebase -i, with <onto> and <upstream> specified as :/quuxery' '
+test_expect_success 'rebase -i, with <onto> and <upstream> specified as :/quuxery' '
        test_when_finished "git branch -D torebase" &&
        git checkout -b torebase branch1 &&
        upstream=$(git rev-parse ":/J") &&