git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Trim leading / off of paths in git-svn prop_walk
@ 2008-01-09  6:37 Kevin Ballard
  2008-01-09 20:54 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Ballard @ 2008-01-09  6:37 UTC (permalink / raw)
  To: git; +Cc: gitster, Kevin Ballard

prop_walk adds a leading / to all subdirectory paths. Unfortunately
this causes a problem when the remote repo lives in a subdirectory itself,
as the leading / causes subsequent PROPFIND calls to be executed on
the wrong path. Trimming the / before calling the PROPFIND fixes this problem.

Signed-off-by: Kevin Ballard <kevin@sb.org>
---
All tests passed after this change, but since it seems to only apply
to WebDAV SVN repos I saw no way to add a new test.
 git-svn.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 3308fe1..d5316eb 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1858,6 +1858,7 @@ sub rel_path {
 sub prop_walk {
 	my ($self, $path, $rev, $sub) = @_;
 
+	$path =~ s#^/##;
 	my ($dirent, undef, $props) = $self->ra->get_dir($path, $rev);
 	$path =~ s#^/*#/#g;
 	my $p = $path;
-- 
1.5.4.rc2.68.ge708a-dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Trim leading / off of paths in git-svn prop_walk
  2008-01-09  6:37 [PATCH] Trim leading / off of paths in git-svn prop_walk Kevin Ballard
@ 2008-01-09 20:54 ` Junio C Hamano
  2008-01-09 22:55   ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2008-01-09 20:54 UTC (permalink / raw)
  To: Eric Wong; +Cc: git, Kevin Ballard

Kevin Ballard <kevin@sb.org> writes:

> prop_walk adds a leading / to all subdirectory paths. Unfortunately
> this causes a problem when the remote repo lives in a subdirectory itself,
> as the leading / causes subsequent PROPFIND calls to be executed on
> the wrong path. Trimming the / before calling the PROPFIND fixes this problem.
>
> Signed-off-by: Kevin Ballard <kevin@sb.org>

Eric, the change is very limited in scope (only the parameter to
ra->get_dir() changes) so I can apply myself, if you agree this
is a trivially correct fix.  I just do not know svn-perl
interface well enough to judge.

> All tests passed after this change, but since it seems to only apply
> to WebDAV SVN repos I saw no way to add a new test.
>  git-svn.perl |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/git-svn.perl b/git-svn.perl
> index 3308fe1..d5316eb 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -1858,6 +1858,7 @@ sub rel_path {
>  sub prop_walk {
>  	my ($self, $path, $rev, $sub) = @_;
>  
> +	$path =~ s#^/##;
>  	my ($dirent, undef, $props) = $self->ra->get_dir($path, $rev);
>  	$path =~ s#^/*#/#g;
>  	my $p = $path;
> -- 
> 1.5.4.rc2.68.ge708a-dirty

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Trim leading / off of paths in git-svn prop_walk
  2008-01-09 20:54 ` Junio C Hamano
@ 2008-01-09 22:55   ` Eric Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2008-01-09 22:55 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Kevin Ballard, Benoit Sigoure

Junio C Hamano <gitster@pobox.com> wrote:
> Kevin Ballard <kevin@sb.org> writes:
> 
> > prop_walk adds a leading / to all subdirectory paths. Unfortunately
> > this causes a problem when the remote repo lives in a subdirectory itself,
> > as the leading / causes subsequent PROPFIND calls to be executed on
> > the wrong path. Trimming the / before calling the PROPFIND fixes this problem.
> >
> > Signed-off-by: Kevin Ballard <kevin@sb.org>
> 
> Eric, the change is very limited in scope (only the parameter to
> ra->get_dir() changes) so I can apply myself, if you agree this
> is a trivially correct fix.  I just do not know svn-perl
> interface well enough to judge.

Yes it is.  It appears this regression was introduced in
01bdab84e31763a98206c31cf99b9dc3cb221356 so yes, it's trivially
correct :)

Acked-by: Eric Wong <normalperson@yhbt.net>

> 
> > All tests passed after this change, but since it seems to only apply
> > to WebDAV SVN repos I saw no way to add a new test.
> >  git-svn.perl |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/git-svn.perl b/git-svn.perl
> > index 3308fe1..d5316eb 100755
> > --- a/git-svn.perl
> > +++ b/git-svn.perl
> > @@ -1858,6 +1858,7 @@ sub rel_path {
> >  sub prop_walk {
> >  	my ($self, $path, $rev, $sub) = @_;
> >  
> > +	$path =~ s#^/##;
> >  	my ($dirent, undef, $props) = $self->ra->get_dir($path, $rev);
> >  	$path =~ s#^/*#/#g;
> >  	my $p = $path;
> > -- 
> > 1.5.4.rc2.68.ge708a-dirty

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-09 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-09  6:37 [PATCH] Trim leading / off of paths in git-svn prop_walk Kevin Ballard
2008-01-09 20:54 ` Junio C Hamano
2008-01-09 22:55   ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).