为什么jGit RemoteAdd命令不能像其他命令一样链接?

时间:2018-11-07 17:55:56

标签: jgit

我最近一直在使用jGit,但我注意到RemoteAddCommand没有像其他命令那样使用可链接模型。

// doesn't compile because setName returns void
git.remoteAdd().setName('other').setUri(new URIish(destUri)).call()
// works fine   
 git.push().setRemote('other').setPushTags().setPushAll().setProgressMonitor(new TextProgressMonitor()).call()

否则,API看起来是如此一致(而且稳定),以至于很难想象这是一个疏忽。这里的设计思想是什么?还是疏忽?

1 个答案:

答案 0 :(得分:0)

我想您已经从JGit购物中心列表中找到答案了:https://www.eclipse.org/lists/jgit-dev/msg03705.html。我只是将线程重新发布在这里,以便其他人可以看到它:

  

此问题已由https://git.eclipse.org/r/c/123762/(链式RemoteAddCommand方法,2018-05-30)修复,并且此修复程序是JGit 5.0和更高版本的一部分。

因此可以使用JGit 5.0 +。

相关问题