| Summary: | Add LsRemoteCommand to API | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Technology] JGit | Reporter: | Christoph Brill <egore> | ||||||||
| Component: | JGit | Assignee: | Christoph Brill <egore> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | enhancement | ||||||||||
| Priority: | P3 | CC: | caniszczyk | ||||||||
| Version: | 0.10.0 | Keywords: | api, noteworthy | ||||||||
| Target Milestone: | 1.0.0 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Christoph Brill
Created attachment 194039 [details]
LsRemoteCommand.java
Initial attempt at implementing ls-remote.
It seems to work but filtering for tags does not work. It seems like a bug in FetchProcess where the "Set<Ref> matched" is filled but never used. Or maybe I'm doing it wrong?
My simple test program is:
Repository repo = new FileRepository("jgit/.git");
LsRemoteCommand lsRemoteCommand = new LsRemoteCommand(repo);
lsRemoteCommand.setTags(true);
FetchResult call = lsRemoteCommand.call();
for (Ref s : call.getAdvertisedRefs()) {
System.out.println(s);
}
Created attachment 194699 [details]
LsRemoteCommand.java
Working implementation
Created attachment 194700 [details]
LsRemoteResult.java
Necessary return object
Can you contribute these two patches via Gerrit? http://wiki.eclipse.org/EGit/Contributor_Guide#Contributing_Patches Generally tests are helpful too. I pushed a patch here: http://egit.eclipse.org/r/3346 Please review it if it meets your needs. merged into master as e170c314fb96977650d69f7af206d84a362126be. Also added a LsRemoteCommandTest. Thanks for your contribution Christoph! |