All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git-svn: fix rel_path() when not connected to the repository root
       [not found]   ` <20070325204156.GK942MdfPADPa@greensroom.kotnet.org>
@ 2007-03-25 23:35     ` Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2007-03-25 23:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Sven Verdoolaege

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.
---

Sven: Let me know if this fixes things for your repo.

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

diff --git a/git-svn.perl b/git-svn.perl
index e845789..e0a48c2 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 {
-- 
Eric Wong

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-25 23:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20070325180218.GI942MdfPADPa@greensroom.kotnet.org>
     [not found] ` <20070325201943.GE846@localdomain>
     [not found]   ` <20070325204156.GK942MdfPADPa@greensroom.kotnet.org>
2007-03-25 23:35     ` [PATCH] git-svn: fix rel_path() when not connected to the repository root Eric Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.