tags 578908 + upstream patch
thanks

Jens Seidel wrote:
> On Fri, Apr 23, 2010 at 03:07:44PM +0200, Jens Seidel wrote:

>> $ git svn reset -r13 -p
>> Use of uninitialized value $commit in length at /usr/lib/git-core/git-svn
>> line 3604.
>> arg3 must be a full SHA1 hexsum
>
> Oops, the revision I specified (13) is invalid, the current branch (trunk)
> starts with a higher number (I moved branches in Subversion in the past). I
> tried to specify the 13th revision from HEAD (in reverse order) but did it
> wrong.
> 
> Nevertheless there should be a proper error message and nothing about
> "uninitialized values", you probably agree.

Yes, I do.  Sorry to take so long to get back to you; does this patch help?

diff --git a/git-svn.perl b/git-svn.perl
index 2c86ea2..97f3891 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1185,6 +1185,7 @@ sub cmd_reset {
                    "history\n";
        }
        my ($r, $c) = $gs->find_rev_before($target, not $_fetch_parent);
+       die "Cannot find SVN revision $target\n" unless defined($c);
        $gs->rev_map_set($r, $c, 'reset', $uuid);
        print "r$r = $c ($gs->{ref_id})\n";
 }
@@ -3605,6 +3606,7 @@ sub mkfile {
 
 sub rev_map_set {
        my ($self, $rev, $commit, $update_ref, $uuid) = @_;
+       defined $commit or die "missing arg3";
        length $commit == 40 or die "arg3 must be a full SHA1 hexsum\n";
        my $db = $self->map_path($uuid);
        my $db_lock = "$db.lock";
-- 



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to