send-pack: tighten checks for remote names
[gitweb.git] / git-svn.perl
index 819584baf568aaa77a02df5c529719d692d43caa..15254e479595de047258188e0979bea322869696 100755 (executable)
@@ -31,7 +31,7 @@
              'svn:entry:committed-date' => 1,
 );
 
-sub fatal (@) { print STDERR $@; exit 1 }
+sub fatal (@) { print STDERR @_; exit 1 }
 # If SVN:: library support is added, please make the dependencies
 # optional and preserve the capability to use the command-line client.
 # use eval { require SVN::... } to make it lazy load
@@ -2027,9 +2027,17 @@ sub git_commit {
 
        # just in case we clobber the existing ref, we still want that ref
        # as our parent:
-       if (my $cur = eval { file_to_s("$GIT_DIR/refs/remotes/$GIT_SVN") }) {
+       open my $null, '>', '/dev/null' or croak $!;
+       open my $stderr, '>&', \*STDERR or croak $!;
+       open STDERR, '>&', $null or croak $!;
+       if (my $cur = eval { safe_qx('git-rev-parse',
+                                    "refs/remotes/$GIT_SVN^0") }) {
+               chomp $cur;
                push @tmp_parents, $cur;
        }
+       open STDERR, '>&', $stderr or croak $!;
+       close $stderr or croak $!;
+       close $null or croak $!;
 
        if (exists $tree_map{$tree}) {
                foreach my $p (@{$tree_map{$tree}}) {