List of usage examples for org.eclipse.jgit.api LsRemoteCommand call
@Override public Collection<Ref> call() throws GitAPIException, InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException
Execute the LsRemote command with all the options and parameters collected by the setter methods (e.g.
From source file:org.jenkinsci.git.LsRemoteOperation.java
License:Open Source License
public ObjectId call() throws IOException { LsRemoteCommand ls = Git.wrap(gitRepo).lsRemote(); ls.setRemote(repo.getUri());/*from w ww.ja v a2 s . co m*/ String branch = repo.getBranch(); Collection<Ref> refs; try { refs = ls.call(); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e); } for (Ref ref : refs) if (branch.equals(ref.getName())) return ref.getObjectId(); return null; }