org.eclipse.jgit.api.Git.lsRemoteRepository()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(278)

本文整理了Java中org.eclipse.jgit.api.Git.lsRemoteRepository()方法的一些代码示例,展示了Git.lsRemoteRepository()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Git.lsRemoteRepository()方法的具体详情如下:
包路径:org.eclipse.jgit.api.Git
类名称:Git
方法名:lsRemoteRepository

Git.lsRemoteRepository介绍

[英]Return a command to list remote branches/tags without a local repository.
[中]

代码示例

代码示例来源:origin: centic9/jgit-cookbook

public static void main(String[] args) throws GitAPIException {
  Collection<Ref> refs = Git.lsRemoteRepository()
      .setHeads(true)
      .setTags(true)
  final Map<String, Ref> map = Git.lsRemoteRepository()
      .setHeads(true)
      .setTags(true)
  refs = Git.lsRemoteRepository()
      .setRemote(REMOTE_URL)
      .call();

代码示例来源:origin: centic9/jgit-cookbook

public static void main(String[] args) throws GitAPIException {
  Collection<Ref> refs = Git.lsRemoteRepository()
      .setHeads(true)
      .setTags(true)
  final Map<String, Ref> map = Git.lsRemoteRepository()
      .setHeads(true)
      .setTags(true)
  refs = Git.lsRemoteRepository()
      .setRemote(REMOTE_URL)
      .call();

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

@Override
public ObjectId sha1(String uri, String ref) throws GitAPIException {
  Map<String, Ref> map = Git
      .lsRemoteRepository()
      .setRemote(uri)
      .callAsMap();
  Ref r = RefDatabase.findRef(map, ref);
  return r != null ? r.getObjectId() : null;
}

代码示例来源:origin: FlowCI/flow-platform

@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));
  }
}

代码示例来源:origin: FlowCI/flow-platform

@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);
  }
}

代码示例来源:origin: gradle.plugin.org.echocat.gradle.plugins/gradle-golang-plugin

@Nullable
@Override
protected String refFor(@Nonnull Matcher matcher, @Nonnull RawVcsReference rawReference) throws VcsException {
  final String root = rootFor(matcher, rawReference);
  final String remoteUri = buildUriFor(root, rawReference);
  LOGGER.debug("Fetch remote refs for {} from {}...", rawReference.getId(), remoteUri);
  final Collection<Ref> refs;
  try {
    refs = Git.lsRemoteRepository()
      .setRemote(remoteUri)
      .call();
  } catch (final GitAPIException e) {
    throw new VcsException(e);
  }
  LOGGER.debug("Fetch remote refs for {} from {}... DONE!", rawReference.getId(), remoteUri);
  return selectBestFitRefFor(matcher, rawReference, refs);
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

public ObjectId sha1(String uri, String ref) throws GitAPIException {
  Map<String, Ref> map = Git
      .lsRemoteRepository()
      .setRemote(uri)
      .callAsMap();
  Ref r = RefDatabase.findRef(map, ref);
  return r != null ? r.getObjectId() : null;
}

代码示例来源:origin: berlam/github-bucket

@Override
public ObjectId sha1(String uri, String ref) throws GitAPIException {
  Map<String, Ref> map = Git
      .lsRemoteRepository()
      .setRemote(uri)
      .callAsMap();
  Ref r = RefDatabase.findRef(map, ref);
  return r != null ? r.getObjectId() : null;
}

代码示例来源:origin: echocat/gradle-golang-plugin

@Nullable
protected Ref resolveRemoteRef() throws VcsException, GitAPIException {
  LOGGER.debug("Fetch remote refs from {}...", getReference().getUri());
  final Iterable<Ref> refs = RefComparator.sort(Git.lsRemoteRepository()
    .setRemote(gitVcsUriFor(getReference()).getUri().toString())
    .call());
  LOGGER.debug("Fetch remote refs from {}... DONE!", getReference().getUri());
  return selectFirstMatching(refs);
}

代码示例来源:origin: gradle.plugin.org.echocat.gradle.plugins/gradle-golang-plugin

@Nullable
protected Ref resolveRemoteRef() throws VcsException, GitAPIException {
  LOGGER.debug("Fetch remote refs from {}...", getReference().getUri());
  final Iterable<Ref> refs = RefComparator.sort(Git.lsRemoteRepository()
    .setRemote(gitVcsUriFor(getReference()).getUri().toString())
    .call());
  LOGGER.debug("Fetch remote refs from {}... DONE!", getReference().getUri());
  return selectFirstMatching(refs);
}

代码示例来源:origin: kiegroup/droolsjbpm-tools

refs = Git.lsRemoteRepository()
    .setHeads(true)
    .setTags(true)

代码示例来源:origin: Calsign/APDE

Collection<Ref> refs = Git.lsRemoteRepository().setHeads(true).setTags(true).setRemote(remoteURI).call();

相关文章