Merge branch 'ef/maint-rebase-error-message'
authorJunio C Hamano <gitster@pobox.com>
Fri, 1 Jun 2012 20:28:25 +0000 (13:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Jun 2012 20:28:25 +0000 (13:28 -0700)
By Erik Faye-Lund
* ef/maint-rebase-error-message:
rebase: report invalid commit correctly

git-rebase.sh
t/t3406-rebase-message.sh
index 9148ec25c1c865f28a84e64ae67c85dca28f1eaf..e6167374445dfbb5e0b6bedc9a5f33a01cb5a7df 100755 (executable)
@@ -424,7 +424,7 @@ case "$onto_name" in
        ;;
 *)
        onto=$(git rev-parse --verify "${onto_name}^0") ||
-       die "Does not point to a valid commit: $1"
+       die "Does not point to a valid commit: $onto_name"
        ;;
 esac
 
index fe5f936988bc5ec9bbe6d9175ef6e085c422eadc..6898377910f9fce8ccc73fba7b8140dff53d7ec6 100755 (executable)
@@ -62,4 +62,9 @@ test_expect_success 'rebase -n overrides config rebase.stat config' '
         ! grep "^ fileX |  *1 +$" diffstat.txt
 '
 
+test_expect_success 'rebase --onto outputs the invalid ref' '
+       test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err &&
+       grep "invalid-ref" err
+'
+
 test_done