Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Why does jGit RemoteAdd command not chain like the others?

Hi,

Christian Bongiorno wrote:

I have recently been using jGit and I noticed that the RemoteAddCommand doesn't use a chainable model like the other commands.

// 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()
The APIs seem so consistent otherwise (and stable) that it's hard to imagine this was an oversight. What was the design thinking here? or was it an oversight?

Thanks for writing! This was fixed by https://git.eclipse.org/r/c/123762/ (Chain RemoteAddCommand methods, 2018-05-30) and the fix is part of JGit 5.0 and newer.

Hope that helps,
Jonathan

Back to the top