@Override public List<String> tags() throws GitException { try { Collection<Ref> refs = buildCommand(Git.lsRemoteRepository() .setTags(true) .setTimeout(GIT_TRANS_TIMEOUT) .setRemote(gitUrl)).call(); List<Ref> listRefs = Lists.newArrayList(refs); listRefs.sort(JGitUtil.REF_COMPARATOR); return JGitUtil.simpleRef(refs); } catch (GitAPIException e) { throw new GitException("Fail to list tags from remote repo", ExceptionUtil.findRootCause(e)); } }
@Override public List<String> branches() throws GitException { try { Collection<Ref> refs = buildCommand(Git.lsRemoteRepository() .setHeads(true) .setTimeout(GIT_TRANS_TIMEOUT) .setRemote(gitUrl)).call(); return JGitUtil.simpleRef(refs); } catch (GitAPIException e) { throw new GitException("Fail to list branches from remote repo", e); } }
for (Ref ref : git.lsRemote().setTimeout(timeoutInSeconds).setCredentialsProvider(credentialsProvider) .setTags(false) .setHeads(true)