From: Eric Wong Date: Sat, 25 Jul 2009 20:14:16 +0000 (-0700) Subject: git svn: make minimize URL more reliable over http(s) X-Git-Tag: v1.6.4-rc3~2^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5f8b2cbacd3bad38d0ae4d358fe9b34e98190935;p=git.git git svn: make minimize URL more reliable over http(s) In addition to path-based restrictions, Subversion servers over http(s) may have access controls implemented via the LimitExcept directive in Apache. In some cases, LimitExcept may be (arguably) misconfigured to not allow REPORT requests while allowing OPTIONS and PROPFIND. This caused problems with our existing minimize_url logic that only issued OPTIONS and PROPFIND requests when connecting and using SVN::Ra::get_latest_revnum. We now call SVN::Ra::get_log if get_latest_revnum succeeds, resulting in a REPORT request being sent. This will increase our chances of tripping access controls before we start attempting to fetch history. Signed-off-by: Eric Wong --- diff --git a/git-svn.perl b/git-svn.perl index fd7232cf6..d07581072 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -4831,7 +4831,11 @@ sub minimize_url { my $c = ''; do { $url .= "/$c" if length $c; - eval { (ref $self)->new($url)->get_latest_revnum }; + eval { + my $ra = (ref $self)->new($url); + my $latest = $ra->get_latest_revnum; + $ra->get_log("", $latest, 0, 1, 0, 1, sub {}); + }; } while ($@ && ($c = shift @components)); $url; }