Skip to content

Commit b54a901

Browse files
Eric Wonggitster
authored andcommitted
git-svn: cleanup: factor out longest_common_path() function
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1be846f commit b54a901

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

git-svn.perl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,11 +3072,8 @@ sub gs_do_switch {
30723072
$editor->{git_commit_ok};
30733073
}
30743074

3075-
sub gs_fetch_loop_common {
3076-
my ($self, $base, $head, $gsv, $globs) = @_;
3077-
return if ($base > $head);
3078-
my $inc = $_log_window_size;
3079-
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
3075+
sub longest_common_path {
3076+
my ($gsv, $globs) = @_;
30803077
my %common;
30813078
my $common_max = scalar @$gsv;
30823079

@@ -3108,6 +3105,15 @@ sub gs_fetch_loop_common {
31083105
last;
31093106
}
31103107
}
3108+
$longest_path;
3109+
}
3110+
3111+
sub gs_fetch_loop_common {
3112+
my ($self, $base, $head, $gsv, $globs) = @_;
3113+
return if ($base > $head);
3114+
my $inc = $_log_window_size;
3115+
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
3116+
my $longest_path = longest_common_path($gsv, $globs);
31113117
while (1) {
31123118
my %revs;
31133119
my $err;

0 commit comments

Comments
 (0)