Re: calling git rebase with invalid onto-ref exits with wrong error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 30, 2012 at 11:02 AM, Manuela Hutter <manuelah@xxxxxxxxx> wrote:
> Just noticed a small bug (in git version 1.7.10.msysgit.1):
>
> calling
>   git rebase --onto <onto-ref> <base-ref> <branch-ref>
>
> with an unknown <onto-ref> reports:
>   fatal: Needed a single revision
>   Does not point to a valid commit: <branch-ref>
>
> Expected:
>   fatal: Needed a single revision
>   Does not point to a valid commit: <onto-ref>
>

Indeed. This looks like the result of a bad merge-resolution, but I
could be mistaken. This looks like the correct solution to me:

diff --git a/git-rebase.sh b/git-rebase.sh
index 24a2840..3267c92 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -423,7 +423,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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]