X-Git-Url: https://git.octo.it/?p=git.git;a=blobdiff_plain;f=git-svnimport.perl;fp=git-svnimport.perl;h=20a85724cb1660a3411fa34717cd5f1e98ebd731;hp=45486a852cd21dd05b5ea4fb7a2b29e4addd7606;hb=29504118f8528f658fd0bfc02d8d78d4c01dc2cc;hpb=40dad96e41fcb96e31bdf11deec3c7bf6261adbe diff --git a/git-svnimport.perl b/git-svnimport.perl index 45486a85..20a85724 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -108,7 +108,7 @@ sub conn { sub file { my($self,$path,$rev) = @_; - my ($fh, $name) = tempfile('gitsvn.XXXXXX', + my ($fh, $name) = tempfile('gitsvn.XXXXXX', DIR => File::Spec->tmpdir(), UNLINK => 1); print "... $rev $path ...\n" if $opt_v; @@ -163,9 +163,9 @@ sub getwd() { sub get_headref($$) { my $name = shift; - my $git_dir = shift; + my $git_dir = shift; my $sha; - + if (open(C,"$git_dir/refs/heads/$name")) { chomp($sha = ); close(C); @@ -235,7 +235,7 @@ EOM $forward_master = $opt_o ne 'master' && -f "$git_dir/refs/heads/master" && - system('cmp', '-s', "$git_dir/refs/heads/master", + system('cmp', '-s', "$git_dir/refs/heads/master", "$git_dir/refs/heads/$opt_o") == 0; # populate index @@ -285,8 +285,8 @@ sub get_file($$$) { $res = $lwp_ua->request($req); if ($res->is_success) { my $fh; - ($fh, $name) = tempfile('gitsvn.XXXXXX', - DIR => File::Spec->tmpdir(), UNLINK => 1); + ($fh, $name) = tempfile('gitsvn.XXXXXX', + DIR => File::Spec->tmpdir(), UNLINK => 1); print $fh $res->content; close($fh) or die "Could not write $name: $!\n"; } else { @@ -352,7 +352,7 @@ sub copy_subdir($$$$$$) { print "... found $path$p ...\n" if $opt_v; push(@$new,[$mode,$sha1,$path.$p]); } - close($f) or + close($f) or print STDERR "$newrev:$newbranch: could not list files in $oldpath \@ $rev\n"; } @@ -567,7 +567,7 @@ sub commit { push @par, '-p', $mparent; print OUT "Merge parent branch: $mparent\n" if $opt_v; } - } + } } exec("env", @@ -604,7 +604,7 @@ sub commit { print "... no known parent\n" if $opt_v; } elsif(not $tag) { print "Writing to refs/heads/$dest\n" if $opt_v; - open(C,">$git_dir/refs/heads/$dest") and + open(C,">$git_dir/refs/heads/$dest") and print C ("$cid\n") and close(C) or die "Cannot write branch $dest for update: $!\n"; @@ -614,7 +614,7 @@ sub commit { my($in, $out) = ('',''); $last_rev = "-" if %$changed_paths; # the tag was 'complex', i.e. did not refer to a "real" revision - + $dest =~ tr/_/\./ if $opt_u; my $pid = open2($in, $out, 'git-mktag');