Browse Source

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

It was traversing the entire repository before.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Eric Wong 18 years ago committed by Junio C Hamano
parent
commit
102a0a2db1
  1. 4
      git-svn.perl

4
git-svn.perl

@ -447,7 +447,7 @@ sub cmd_show_ignore {
my $url = (::working_head_info('HEAD'))[0]; my $url = (::working_head_info('HEAD'))[0];
my $gs = Git::SVN->find_by_url($url) || Git::SVN->new; my $gs = Git::SVN->find_by_url($url) || Git::SVN->new;
my $r = (defined $_revision ? $_revision : $gs->ra->get_latest_revnum); 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 { sub cmd_multi_init {
@ -1334,7 +1334,7 @@ sub traverse_ignore {
my $ra = $self->ra; my $ra = $self->ra;
my ($dirent, undef, $props) = $ra->get_dir($path, $r); my ($dirent, undef, $props) = $ra->get_dir($path, $r);
my $p = $path; 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"; print $fh length $p ? "\n# $p\n" : "\n# /\n";
if (my $s = $props->{'svn:ignore'}) { if (my $s = $props->{'svn:ignore'}) {
$s =~ s/[\r\n]+/\n/g; $s =~ s/[\r\n]+/\n/g;

Loading…
Cancel
Save