summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-06-13 09:37:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-13 17:56:44 (GMT)
commitb54a901e05235b2717da54d2a51b8cbd571cefcd (patch)
treef3c065a5052494372a90ed42ecf7761f42b1a6b9 /git-svn.perl
parent1be846f6e48bae57c3d5cc346300eaf9550f6c8d (diff)
downloadgit-b54a901e05235b2717da54d2a51b8cbd571cefcd.zip
git-b54a901e05235b2717da54d2a51b8cbd571cefcd.tar.gz
git-b54a901e05235b2717da54d2a51b8cbd571cefcd.tar.bz2
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>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl16
1 files changed, 11 insertions, 5 deletions
diff --git a/git-svn.perl b/git-svn.perl
index e350061..58f7dd0 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -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;
@@ -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;