Skip to content

Commit

Permalink
git-svn: cleanup: factor out longest_common_path() function
Browse files Browse the repository at this point in the history
I hadn't looked at this code in a while and had to read this
again to figure out what it did.  To avoid having to do this
again in the future, I just gave gave the hunk a descriptive
name.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Jun 13, 2007
1 parent 1be846f commit b54a901
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -3072,11 +3072,8 @@ sub gs_do_switch {
$editor->{git_commit_ok};
}

sub gs_fetch_loop_common {
my ($self, $base, $head, $gsv, $globs) = @_;
return if ($base > $head);
my $inc = $_log_window_size;
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
sub longest_common_path {
my ($gsv, $globs) = @_;
my %common;
my $common_max = scalar @$gsv;

Expand Down Expand Up @@ -3108,6 +3105,15 @@ sub gs_fetch_loop_common {
last;
}
}
$longest_path;
}

sub gs_fetch_loop_common {
my ($self, $base, $head, $gsv, $globs) = @_;
return if ($base > $head);
my $inc = $_log_window_size;
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
my $longest_path = longest_common_path($gsv, $globs);
while (1) {
my %revs;
my $err;
Expand Down

0 comments on commit b54a901

Please sign in to comment.