Skip to content

Commit 278fcd7

Browse files
author
Junio C Hamano
committed
Merge branch 'maint'
* maint: git-svn: avoid fetching files twice in the same revision
2 parents 3683dc5 + 6173c19 commit 278fcd7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

git-svn.perl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2982,7 +2982,7 @@ sub libsvn_fetch_delta {
29822982
sub libsvn_fetch_full {
29832983
my ($last_commit, $paths, $rev, $author, $date, $msg) = @_;
29842984
open my $gui, '| git-update-index -z --index-info' or croak $!;
2985-
my @amr;
2985+
my %amr;
29862986
my $p = $SVN->{svn_path};
29872987
foreach my $f (keys %$paths) {
29882988
my $m = $paths->{$f}->action();
@@ -3001,21 +3001,21 @@ sub libsvn_fetch_full {
30013001
my $t = $SVN->check_path($f, $rev, $pool);
30023002
if ($t == $SVN::Node::file) {
30033003
if ($m =~ /^[AMR]$/) {
3004-
push @amr, [ $m, $f ];
3004+
$amr{$f} = $m;
30053005
} else {
30063006
die "Unrecognized action: $m, ($f r$rev)\n";
30073007
}
30083008
} elsif ($t == $SVN::Node::dir && $m =~ /^[AR]$/) {
30093009
my @traversed = ();
30103010
libsvn_traverse($gui, '', $f, $rev, \@traversed);
30113011
foreach (@traversed) {
3012-
push @amr, [ $m, $_ ]
3012+
$amr{$_} = $m;
30133013
}
30143014
}
30153015
$pool->clear;
30163016
}
3017-
foreach (@amr) {
3018-
libsvn_get_file($gui, $_->[1], $rev, $_->[0]);
3017+
foreach (keys %amr) {
3018+
libsvn_get_file($gui, $_, $rev, $amr{$_});
30193019
}
30203020
close $gui or croak $?;
30213021
return libsvn_log_entry($rev, $author, $date, $msg, [$last_commit]);

0 commit comments

Comments
 (0)