Skip to content

Commit 70ee0b7

Browse files
jrnEric Wong
authored andcommitted
git svn: avoid uninitialized var in 'reset'
When "git svn reset" is called with an invalid revision, we bail out and show the user a proper error message instead of giving them a cryptic one related to git-svn internals. ref: http://bugs.debian.org/578908 Signed-off-by: Jonathan Nieder <[email protected]> Reported-by: Jens Seidel <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent 212f0ba commit 70ee0b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

git-svn.perl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,7 @@ sub cmd_reset {
11851185
"history\n";
11861186
}
11871187
my ($r, $c) = $gs->find_rev_before($target, not $_fetch_parent);
1188+
die "Cannot find SVN revision $target\n" unless defined($c);
11881189
$gs->rev_map_set($r, $c, 'reset', $uuid);
11891190
print "r$r = $c ($gs->{ref_id})\n";
11901191
}
@@ -3605,6 +3606,7 @@ sub mkfile {
36053606

36063607
sub rev_map_set {
36073608
my ($self, $rev, $commit, $update_ref, $uuid) = @_;
3609+
defined $commit or die "missing arg3\n";
36083610
length $commit == 40 or die "arg3 must be a full SHA1 hexsum\n";
36093611
my $db = $self->map_path($uuid);
36103612
my $db_lock = "$db.lock";

0 commit comments

Comments
 (0)