当尝试 git svn dcommit
到名称中有空格的存储库时,出现以下错误:
Committing to http://svn.kuluvalley.com/Meet the Expert/trunk ...
http://svn.kuluvalley.com/Meet the Expert/trunk
Filesystem has no item: '/!svn/bc/7397/Meet' path not found at /usr/libexec/git-core/git svn line 592
看起来 git svn
不支持其中包含空格的目录。
最佳答案
我能够通过修补 git-svn 来解决 git svn
不适用于其中有空格的存储库的问题。
我将 url_path
函数更新为:
sub url_path {
my ($self, $path) = @_;
my $url = $self->{url} . '/' . $self->repo_path($path);
if ($self->{url} =~ m#^https?://#) {
$url =~ s!([^~a-zA-Z0-9_./-])!uc sprintf("%%%02x",ord($1))!eg;
$url =~ s!^(https?)%3A//!$1://!;
}
$url
}
对于 windows (x64) 用户,可以在 Editor.pm 文件中找到此功能,该文件位于
{Git installation folder}\mingw64\share\perl5\site_perl\Git\SVN\
这确保了 url 中的空格被正确编码。
它似乎对我有用,但尚未经过彻底测试。
关于git-svn dcommit 失败,因为存储库名称包含空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7584605/