{"thread":{"id":"7398","subject":"[PATCH] git-svn: fix rel_path() when not connected to the repository root","startedAt":"2007-03-25T23:35:31Z","lastAt":"2007-03-25T23:35:31Z","messageCount":1,"participants":["Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"37973","messageId":"20070325233531.GA13433@muzzle","threadId":"7398","inReplyTo":"20070325204156.GK942MdfPADPa@greensroom.kotnet.org","subject":"[PATCH] git-svn: fix rel_path() when not connected to the repository root","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-03-25T23:35:31Z","receivedAt":"2007-03-25T23:35:31Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This should fix fetching for people who did not use\n\"git svn --minimize\" or cannot connect to the repository root\ndue to the lack of permissions.\n\nI'm not sure what I was on when I made the change to the\nrel_path() function in 4e9f6cc78e5d955bd0faffe76ae9aea6590189f1\nthat made it die() when we weren't connected to the repository\nroot :x\n\nThanks to Sven Verdoolaege for reporting this bug.\n---\n\nSven: Let me know if this fixes things for your repo.\n\n git-svn.perl |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex e845789..e0a48c2 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1327,8 +1327,10 @@ sub rel_path {\n \tmy ($self) = @_;\n \tmy $repos_root = $self->ra->{repos_root};\n \treturn $self->{path} if ($self->{url} eq $repos_root);\n-\tdie \"BUG: rel_path failed! repos_root: $repos_root, Ra URL: \",\n-\t    $self->ra->{url}, \" path: $self->{path},  URL: $self->{url}\\n\";\n+\tmy $url = $self->{url} .\n+\t          (length $self->{path} ? \"/$self->{path}\" : $self->{path});\n+\t$url =~ s!^\\Q$repos_root\\E(?:/+|$)!!g;\n+\t$url;\n }\n \n sub traverse_ignore {\n-- \nEric Wong\n"}]}