Skip to content

Commit 3ba4663

Browse files
committed
Merge branch 'ef/maint-rebase-error-message'
By Erik Faye-Lund * ef/maint-rebase-error-message: rebase: report invalid commit correctly
2 parents 264d5a7 + 9180fea commit 3ba4663

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

git-rebase.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ case "$onto_name" in
424424
;;
425425
*)
426426
onto=$(git rev-parse --verify "${onto_name}^0") ||
427-
die "Does not point to a valid commit: $1"
427+
die "Does not point to a valid commit: $onto_name"
428428
;;
429429
esac
430430

t/t3406-rebase-message.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,9 @@ test_expect_success 'rebase -n overrides config rebase.stat config' '
6262
! grep "^ fileX | *1 +$" diffstat.txt
6363
'
6464

65+
test_expect_success 'rebase --onto outputs the invalid ref' '
66+
test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err &&
67+
grep "invalid-ref" err
68+
'
69+
6570
test_done

0 commit comments

Comments
 (0)