Merge branch 'ef/maint-rebase-error-message' into maint
authorJunio C Hamano <gitster@pobox.com>
Sun, 3 Jun 2012 22:52:18 +0000 (15:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 3 Jun 2012 22:52:18 +0000 (15:52 -0700)
When "git rebase" was given a bad commit to replay the history on,
its error message did not correctly give the command line argument
it had trouble parsing.

By Erik Faye-Lund
* ef/maint-rebase-error-message:
rebase: report invalid commit correctly

git-rebase.sh
t/t3406-rebase-message.sh
index 69c1374823084804662dbd6b6d510ec2ec3428e9..03f73da8879455a5b07644f8bc00609b1990b0d9 100755 (executable)
@@ -418,7 +418,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