Skip to content

Commit 2bc35dc

Browse files
alexmvEric Wong
authored andcommitted
git-svn: Set svn.authorsfile to an absolute path when cloning
If --authors-file is passed a relative path, cloning will work, but future `git svn fetch`es will fail to locate the authors file correctly. Thus, use File::Spec->rel2abs to determine an absolute path for the authors file before setting it. Signed-off-by: Alex Vandiver <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent f9ad77a commit 2bc35dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git-svn.perl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,11 @@ sub cmd_clone {
392392
$path = $url;
393393
}
394394
$path = basename($url) if !defined $path || !length $path;
395+
my $authors_absolute = $_authors ? File::Spec->rel2abs($_authors) : "";
395396
cmd_init($url, $path);
396397
Git::SVN::fetch_all($Git::SVN::default_repo_id);
397-
command_oneline('config', 'svn.authorsfile', $_authors) if $_authors;
398+
command_oneline('config', 'svn.authorsfile', $authors_absolute)
399+
if $_authors;
398400
}
399401

400402
sub cmd_init {

0 commit comments

Comments
 (0)