Explicitly add the default "git pull" behaviour to .git/config on clone
[gitweb.git] / git-svn.perl
index 3891122d73c6f76f41f31cc6280f9d6c40581d62..747daf0181babeae63378a6ec49a8bc4b7f70a0f 100755 (executable)
@@ -459,6 +459,7 @@ sub fetch_lib {
                $min = $max + 1;
                $max += $inc;
                $max = $head if ($max > $head);
+               $SVN = libsvn_connect($SVN_URL);
        }
        restore_index($index);
        return { revision => $last_rev, commit => $last_commit };
@@ -2982,7 +2983,7 @@ sub libsvn_fetch_delta {
 sub libsvn_fetch_full {
        my ($last_commit, $paths, $rev, $author, $date, $msg) = @_;
        open my $gui, '| git-update-index -z --index-info' or croak $!;
-       my @amr;
+       my %amr;
        my $p = $SVN->{svn_path};
        foreach my $f (keys %$paths) {
                my $m = $paths->{$f}->action();
@@ -3001,7 +3002,7 @@ sub libsvn_fetch_full {
                my $t = $SVN->check_path($f, $rev, $pool);
                if ($t == $SVN::Node::file) {
                        if ($m =~ /^[AMR]$/) {
-                               push @amr, [ $m, $f ];
+                               $amr{$f} = $m;
                        } else {
                                die "Unrecognized action: $m, ($f r$rev)\n";
                        }
@@ -3009,13 +3010,13 @@ sub libsvn_fetch_full {
                        my @traversed = ();
                        libsvn_traverse($gui, '', $f, $rev, \@traversed);
                        foreach (@traversed) {
-                               push @amr, [ $m, $_ ]
+                               $amr{$_} = $m;
                        }
                }
                $pool->clear;
        }
-       foreach (@amr) {
-               libsvn_get_file($gui, $_->[1], $rev, $_->[0]);
+       foreach (keys %amr) {
+               libsvn_get_file($gui, $_, $rev, $amr{$_});
        }
        close $gui or croak $?;
        return libsvn_log_entry($rev, $author, $date, $msg, [$last_commit]);