org.eclipse.jgit.lib.Repository.getAdditionalHaves()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(87)

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

Repository.getAdditionalHaves介绍

[英]Objects known to exist but not expressed by #getAllRefs().

When a repository borrows objects from another repository, it can advertise that it safely has that other repository's references, without exposing any other details about the other repository. This may help a client trying to push changes avoid pushing more than it needs to.
[中]已知存在但未用#getAllRefs()表示的对象。
当一个存储库从另一个存储库借用对象时,它可以宣布它安全地拥有另一个存储库的引用,而不公开关于另一个存储库的任何其他详细信息。这可能有助于尝试推动更改的客户避免推动超出其需要的更改。

代码示例

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

advertisedHaves.addAll(additionalHaves);
else
  advertisedHaves.addAll(db.getAdditionalHaves());

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

for (ObjectId id : local.getAdditionalHaves())
  parseReachable(id);

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

advertisedHaves.addAll(additionalHaves);
else
  advertisedHaves.addAll(db.getAdditionalHaves());

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

advertisedHaves.addAll(additionalHaves);
else
  advertisedHaves.addAll(db.getAdditionalHaves());

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

/**
 * Objects known to exist but not expressed by {@link #getAllRefs()}.
 * <p>
 * When a repository borrows objects from another repository, it can
 * advertise that it safely has that other repository's references, without
 * exposing any other details about the other repository.  This may help
 * a client trying to push changes avoid pushing more than it needs to.
 *
 * @return unmodifiable collection of other known objects.
 */
public Set<ObjectId> getAdditionalHaves() {
  HashSet<ObjectId> r = new HashSet<ObjectId>();
  for (AlternateHandle d : objectDatabase.myAlternates()) {
    if (d instanceof AlternateRepository) {
      Repository repo;
      repo = ((AlternateRepository) d).repository;
      for (Ref ref : repo.getAllRefs().values()) {
        if (ref.getObjectId() != null)
          r.add(ref.getObjectId());
        if (ref.getPeeledObjectId() != null)
          r.add(ref.getPeeledObjectId());
      }
      r.addAll(repo.getAdditionalHaves());
    }
  }
  return r;
}

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

for (ObjectId id : local.getAdditionalHaves())
  parseReachable(id);

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

for (ObjectId id : local.getAdditionalHaves())
  parseReachable(id);

相关文章

Repository类方法