summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-05-04 23:36:47 (GMT)
committerEric Wong <normalperson@yhbt.net>2010-05-09 08:22:31 (GMT)
commit70ee0b7797041621b22c448726f4f88102b5a4f5 (patch)
tree44ec4abe4f28515a93fd10e29b92c84c0af3a6a2 /git-svn.perl
parent212f0ba357cde43d1cf66692f73a2f662d13ac55 (diff)
downloadgit-70ee0b7797041621b22c448726f4f88102b5a4f5.zip
git-70ee0b7797041621b22c448726f4f88102b5a4f5.tar.gz
git-70ee0b7797041621b22c448726f4f88102b5a4f5.tar.bz2
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 <jrnieder@gmail.com> Reported-by: Jens Seidel <jensseidel@users.sf.net> Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 2c86ea2..dc66803 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\n";
length $commit == 40 or die "arg3 must be a full SHA1 hexsum\n";
my $db = $self->map_path($uuid);
my $db_lock = "$db.lock";