From: Magnus Kallström Date: Tue, 21 Jun 2011 22:16:43 GMT Subject: Re: Re: Trailing spaces in branchname (git-svn) Message-ID: In-Reply-To: <58D5F1F8-CC94-4629-B476-91512ED35E0E@gmail.com> 2011/6/15 Magnus Kallström > (I hope I get it right now - previously I used Googles web-interface, and I > just couldn't find a way to respond to all. Trying from my email client > instead now... I have even read the 'Welcome post' again :) ) > > Unfortunately, the patch didn't work. > > This is the error I get when it aborts: > Found branch parent: (refs/remotes/CR3533 sökning pÃ¥ fakturabelopp ) > be4dd98d152d82f098b90089f4df6a2d411d84e1 > fatal: Unable to create 'd:/Dev/GIT/svk/KOB/.git/svn/refs/remotes/CR3533 > sökning på fakturabelopp /index.lock': No such file or directory > read-tree be4dd98d152d82f098b90089f4df6a2d411d84e1: command returned error: > 128 > > The patch itself is probably working for other parts, and I even tried a > similar patch back in March. I never managed to figure out where the call to > the locking-function got it's path though. > Hi again! I have now successfully cloned "my" repository with the following changes in git-svn.perl. I'm not sure if the change in "sub refname" is needed, but I will try to reproduce the error when I find the time for it (the full clone fails after 2-3 days). I can't tell if it breaks anything else, but as far as I can tell, the clone is working. Does it look as if the modification is done in the right place? /Magnus ---8<--- diff --git a/git-svn.perl b/git-svn.perl index 7849cfc..c5e2d23 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2126,6 +2126,9 @@ sub refname { # @{ becomes %40{ $refname =~ s{\@\{}{%40\{}g; + # trailing space is not not allowed on Windows + $refname =~ s{ (?=/|\\|$)}{%20}g; + return $refname; } @@ -3883,6 +3886,7 @@ sub _new { } $_[3] = $path = '' unless (defined $path); + $dir =~ s{ (?=/|\\|$)}{%20}g; mkpath([$dir]); bless { ref_id => $ref_id, dir => $dir, index => "$dir/index", ---8<---