summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Eric Wong <normalperson@yhbt.net>2007-03-25 16:35:31 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2007-03-25 18:01:28 -0700
commit0b59451c1be6be3d0df80be9dc8aeedb355ca44b (patch)
treef13c96c812978acc5818714cea868edd230378de
parentuse xmalloc in git.c and help.c (diff)
downloadtgif-0b59451c1be6be3d0df80be9dc8aeedb355ca44b.tar.xz
git-svn: fix rel_path() when not connected to the repository root
This should fix fetching for people who did not use "git svn --minimize" or cannot connect to the repository root due to the lack of permissions. I'm not sure what I was on when I made the change to the rel_path() function in 4e9f6cc78e5d955bd0faffe76ae9aea6590189f1 that made it die() when we weren't connected to the repository root :x Thanks to Sven Verdoolaege for reporting this bug. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-svn.perl6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index e8457893db..e0a48c2a8b 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1327,8 +1327,10 @@ sub rel_path {
my ($self) = @_;
my $repos_root = $self->ra->{repos_root};
return $self->{path} if ($self->{url} eq $repos_root);
- die "BUG: rel_path failed! repos_root: $repos_root, Ra URL: ",
- $self->ra->{url}, " path: $self->{path}, URL: $self->{url}\n";
+ my $url = $self->{url} .
+ (length $self->{path} ? "/$self->{path}" : $self->{path});
+ $url =~ s!^\Q$repos_root\E(?:/+|$)!!g;
+ $url;
}
sub traverse_ignore {