Skip to contentSkip to conversation

git-svn: fix show-ignore when not connected to the repository root

PATCH New Eric Wong 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

PATCH 1/1 git-svn: fix show-ignore when not connected to the repository root

It was traversing the entire repository before.

---
 git-svn.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
git-svn.perl +2 -2
index 41961b5..326e89f 100755
@@ -447,7 +447,7 @@ sub cmd_show_ignore {
 	my $url = (::working_head_info('HEAD'))[0];
 	my $gs = Git::SVN->find_by_url($url) || Git::SVN->new;
 	my $r = (defined $_revision ? $_revision : $gs->ra->get_latest_revnum);
-	$gs->traverse_ignore(\*STDOUT, '', $r);
+	$gs->traverse_ignore(\*STDOUT, $gs->{path}, $r);
 }
 
 sub cmd_multi_init {
@@ -1334,7 +1334,7 @@ sub traverse_ignore {
 	my $ra = $self->ra;
 	my ($dirent, undef, $props) = $ra->get_dir($path, $r);
 	my $p = $path;
-	$p =~ s#^\Q$ra->{svn_path}\E/##;
+	$p =~ s#^\Q$self->{path}\E(/|$)##;
 	print $fh length $p ? "\n# $p\n" : "\n# /\n";
 	if (my $s = $props->{'svn:ignore'}) {
 		$s =~ s/[\r\n]+/\n/g;
Signature · 1 line
1.5.0.1.212.g2e5e24