From 2e6e276decde2a9f04fc29bce734a49d3ba8f484 Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Fri, 14 Jun 2013 18:47:52 +0530 Subject: [PATCH] rebase: use peel_committish() where appropriate The revisions specified on the command-line as and 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 Signed-off-by: Junio C Hamano --- git-rebase.sh | 4 ++-- t/t3400-rebase.sh | 2 +- t/t3404-rebase-interactive.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/git-rebase.sh b/git-rebase.sh index d0c11a910a..6987b9b6db 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -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 diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh index 81ec517629..cbca71ed56 100755 --- a/t/t3400-rebase.sh +++ b/t/t3400-rebase.sh @@ -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 and specified as :/quuxery' ' +test_expect_success 'rebase, with and specified as :/quuxery' ' test_when_finished "git branch -D torebase" && git checkout -b torebase my-topic-branch^ && upstream=$(git rev-parse ":/Add B") && diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index eb241f5312..86917d172f 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -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 and specified as :/quuxery' ' +test_expect_success 'rebase -i, with and specified as :/quuxery' ' test_when_finished "git branch -D torebase" && git checkout -b torebase branch1 && upstream=$(git rev-parse ":/J") && -- 2.11.4.GIT