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 <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Wong committed
Jun 13, 2007 at 02:37 UTC
b54a901e05235b2717da54d2a51b8cbd571cefcd
1 file changed
+11
-5
git-svn.perl
+11
-5
@@ -3072,11 +3072,8 @@ sub gs_do_switch {
3072
$editor->{git_commit_ok};
3073
}
3074
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) = @_;
3077
my %common;
3078
my $common_max = scalar @$gsv;
3079
@@ -3108,6 +3105,15 @@ sub gs_fetch_loop_common {
3105
last;
3106
}
3107
}
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);
3117
while (1) {
3118
my %revs;
3119
my $err;