git_remote_fetch返回错误消息:"没有可用的TLS流"

时间:2017-03-01 08:28:50

标签: c++ fetch libgit2

我正在尝试从BitBucket上的远程存储库中获取。 git_remote_fetch返回错误消息:

there is no TLS stream available

一些想法如何解决这个问题?

这是我的代码:

if(error = git_remote_fetch(remote, NULL,NULL,"fetch")!=0) {
    const git_error *lastError = giterr_last();
    cerr << "problem with fetch, error message : '" << lastError->message <<"'"<< endl;
}

1 个答案:

答案 0 :(得分:0)

我在尝试使用Python和pygit2(后者依赖于libgit2)从git存储库中获取时遇到了同样的错误。我使用的是libgit2(0.25.0)的自编译版本。

使用以下标志重新编译libgit2解决了问题:cmake -DCURL=OFF,如libgit2项目的问题#3786 [1]中所述。

根据pygit2文档[2]编译的完整过程,添加了标记:

$ wget https://github.com/libgit2/libgit2/archive/v0.25.0.tar.gz
$ tar xzf v0.25.0.tar.gz
$ cd libgit2-0.25.0/
$ cmake -DCURL=OFF .
$ make
$ sudo make install

如果您之前编译过一次,请确保删除libgit2的构建目录,否则该标志将无效。

[1] https://github.com/libgit2/libgit2/issues/3786
[2] http://www.pygit2.org/install.html#quick-install

如果您使用操作系统的内置版libgit,我建议您尝试使用已编译的版本。