# [PATCH] git-svn fails in prop_walk if $self->{path} is not empty

2 messages from 2008-05-27 to 2008-05-27. Participants: Gerrit Pape, Nikolaus Schulz.
Thread: https://gitlist.dev/t/13683

## Gerrit Pape, 2008-05-27 08:46

Subject: [PATCH] git-svn fails in prop_walk if $self->{path} is not empty
Message-ID: <20080527084655.20379.qmail@5bba46d46c095e.315fe32.mid.smarden.org>
URL: https://gitlist.dev/e/20080527084655.20379.qmail%405bba46d46c095e.315fe32.mid.smarden.org

```
From: Christian Engwer <christi@uni-hd.de>

If url://repo/trunk is the current Git branch, prop_walk strips trunk
from the path name. That is useful as, for example "git svn show-ignore"
should not return results like

trunk/foo

but

foo

if svn:ignore for trunk includes foo.

The problem now is that prop_walk strips trunk from the path and then
calls itself recursively. But now trunk is missing in the path and
get_dir fails, because it is called for a non existing path.

The attached patch fixed the problem, by adding the priviously stipped
$self->{path} in the recursive call. I tested it with my current
git-svn repository for the commands show-ignore and show-external.

Patch was submitted through
 http://bugs.debian.org/477393

Signed-off-by: Gerrit Pape <pape@smarden.org>
---

I'm not that much a git-svn user, and didn't test this thoroughly.  I'd
be happy if anyone could crossread/test this, and maybe add a Acked-By.

Thanks, Gerrit.


 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 37976f2..72fef16 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1918,7 +1918,7 @@ sub prop_walk {
 
 	foreach (sort keys %$dirent) {
 		next if $dirent->{$_}->{kind} != $SVN::Node::dir;
-		$self->prop_walk($p . $_, $rev, $sub);
+		$self->prop_walk($self->{path} . $p . $_, $rev, $sub);
 	}
 }
 
-- 
1.5.5.1

```

## Nikolaus Schulz, 2008-05-27 22:54

Subject: Re: [PATCH] git-svn fails in prop_walk if $self->{path} is not empty
Message-ID: <20080527225402.GA25550@penelope.zusammrottung.local>
URL: https://gitlist.dev/e/20080527225402.GA25550%40penelope.zusammrottung.local
In-Reply-To: <20080527084655.20379.qmail@5bba46d46c095e.315fe32.mid.smarden.org>

```
Happy coincidence!

This patch happens to fix my problem posted in "git-svn
{show,create}-ignore chokes upon subdirs" today. 

Nikolaus

On Tue, May 27, 2008 at 08:46:55AM +0000, Gerrit Pape wrote:
> From: Christian Engwer <christi@uni-hd.de>
> 
> The problem now is that prop_walk strips trunk from the path and then
> calls itself recursively. But now trunk is missing in the path and
> get_dir fails, because it is called for a non existing path.
> 
> The attached patch fixed the problem, by adding the priviously stipped
> $self->{path} in the recursive call. 
> git-svn repository for the commands show-ignore and show-external.
> 
> Patch was submitted through
>  http://bugs.debian.org/477393
> 
> Signed-off-by: Gerrit Pape <pape@smarden.org>
> ---
> 
> I'm not that much a git-svn user, and didn't test this thoroughly.  I'd
> be happy if anyone could crossread/test this, and maybe add a Acked-By.
> 
> Thanks, Gerrit.
> 
> 
>  git-svn.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index 37976f2..72fef16 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -1918,7 +1918,7 @@ sub prop_walk {
>  
>  	foreach (sort keys %$dirent) {
>  		next if $dirent->{$_}->{kind} != $SVN::Node::dir;
> -		$self->prop_walk($p . $_, $rev, $sub);
> +		$self->prop_walk($self->{path} . $p . $_, $rev, $sub);
>  	}
>  }

```
