Code

svn: Honor --prefix option in init without --stdlayout
authorAdam Brewster <adambrewster@gmail.com>
Tue, 4 Aug 2009 01:40:38 +0000 (21:40 -0400)
committerEric Wong <normalperson@yhbt.net>
Mon, 10 Aug 2009 08:29:40 +0000 (01:29 -0700)
Most users who type

  git svn init file:///tmp/repo --prefix=my-svn/

would expect the root of the svn repository to be tracked by
refs/remotes/my-svn/git-svn.

Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl

index d0758107249f3743795d0961d36906452ac7d00a..fa8583963bcadf9330008049ef7dcf1cbd24722f 100755 (executable)
@@ -3317,7 +3317,8 @@ sub _new {
                $repo_id = $Git::SVN::default_repo_id;
        }
        unless (defined $ref_id && length $ref_id) {
-               $_[2] = $ref_id = $Git::SVN::default_ref_id;
+               $_prefix = '' unless defined($_prefix);
+               $_[2] = $ref_id = $_prefix . $Git::SVN::default_ref_id;
        }
        $_[1] = $repo_id;
        my $dir = "$ENV{GIT_DIR}/svn/$ref_id";