Skip to content

Commit 2e6e276

Browse files
artagnongitster
authored andcommitted
rebase: use peel_committish() where appropriate
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bac1ddd commit 2e6e276

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

git-rebase.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ then
434434
shift
435435
;;
436436
esac
437-
upstream=`git rev-parse --verify "${upstream_name}^0"` ||
437+
upstream=$(peel_committish "${upstream_name}") ||
438438
die "$(eval_gettext "invalid upstream \$upstream_name")"
439439
upstream_arg="$upstream_name"
440440
else
@@ -470,7 +470,7 @@ case "$onto_name" in
470470
fi
471471
;;
472472
*)
473-
onto=$(git rev-parse --verify "${onto_name}^0") ||
473+
onto=$(peel_committish "$onto_name") ||
474474
die "$(eval_gettext "Does not point to a valid commit: \$onto_name")"
475475
;;
476476
esac

t/t3400-rebase.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ test_expect_success 'rebase fast-forward to master' '
8888
test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out
8989
'
9090

91-
test_expect_failure 'rebase, with <onto> and <upstream> specified as :/quuxery' '
91+
test_expect_success 'rebase, with <onto> and <upstream> specified as :/quuxery' '
9292
test_when_finished "git branch -D torebase" &&
9393
git checkout -b torebase my-topic-branch^ &&
9494
upstream=$(git rev-parse ":/Add B") &&

t/t3404-rebase-interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ test_expect_success 'rebase -i respects core.commentchar' '
947947
test B = $(git cat-file commit HEAD^ | sed -ne \$p)
948948
'
949949

950-
test_expect_failure 'rebase -i, with <onto> and <upstream> specified as :/quuxery' '
950+
test_expect_success 'rebase -i, with <onto> and <upstream> specified as :/quuxery' '
951951
test_when_finished "git branch -D torebase" &&
952952
git checkout -b torebase branch1 &&
953953
upstream=$(git rev-parse ":/J") &&

0 commit comments

Comments
 (0)