Tabnine Logo
GitStore$RefData$Builder.build
Code IndexAdd Tabnine to your IDE (free)

How to use
build
method
in
org.eclipse.jgit.generated.storage.dht.proto.GitStore$RefData$Builder

Best Java code snippets using org.eclipse.jgit.generated.storage.dht.proto.GitStore$RefData$Builder.build (Showing top 8 results out of 315)

origin: com.madgag/org.eclipse.jgit.storage.dht

private DhtRef doPeel(final Ref leaf) throws MissingObjectException,
    IOException {
  RevWalk rw = new RevWalk(getRepository());
  try {
    DhtReader ctx = (DhtReader) rw.getObjectReader();
    RevObject obj = rw.parseAny(leaf.getObjectId());
    RefData.Builder d = RefData.newBuilder(((DhtRef) leaf).getRefData());
    ChunkKey oKey = ctx.findChunk(leaf.getObjectId());
    if (oKey != null)
      d.getTargetBuilder().setChunkKey(oKey.asString());
    else
      d.getTargetBuilder().clearChunkKey();
    if (obj instanceof RevTag) {
      ObjectId pId = rw.peel(obj);
      d.getPeeledBuilder().setObjectName(pId.name());
      ChunkKey pKey = ctx.findChunk(pId);
      if (pKey != null)
        d.getPeeledBuilder().setChunkKey(pKey.asString());
      else
        d.getPeeledBuilder().clearChunkKey();
    } else {
      d.clearPeeled();
    }
    d.setIsPeeled(true);
    d.setSequence(d.getSequence() + 1);
    return new DhtObjectIdRef(leaf.getName(), d.build());
  } finally {
    rw.release();
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

private DhtRef doPeel(final Ref leaf) throws MissingObjectException,
    IOException {
  RevWalk rw = new RevWalk(getRepository());
  try {
    DhtReader ctx = (DhtReader) rw.getObjectReader();
    RevObject obj = rw.parseAny(leaf.getObjectId());
    RefData.Builder d = RefData.newBuilder(((DhtRef) leaf).getRefData());
    ChunkKey oKey = ctx.findChunk(leaf.getObjectId());
    if (oKey != null)
      d.getTargetBuilder().setChunkKey(oKey.asString());
    else
      d.getTargetBuilder().clearChunkKey();
    if (obj instanceof RevTag) {
      ObjectId pId = rw.peel(obj);
      d.getPeeledBuilder().setObjectName(pId.name());
      ChunkKey pKey = ctx.findChunk(pId);
      if (pKey != null)
        d.getPeeledBuilder().setChunkKey(pKey.asString());
      else
        d.getPeeledBuilder().clearChunkKey();
    } else {
      d.clearPeeled();
    }
    d.setIsPeeled(true);
    d.setSequence(d.getSequence() + 1);
    return new DhtObjectIdRef(leaf.getName(), d.build());
  } finally {
    rw.release();
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

private RefData newData() throws IOException {
  RefData.Builder d = RefData.newBuilder(oldData);
  clearRefData(d);
  updateSequence(d);
  ObjectId newId = getNewObjectId();
  d.getTargetBuilder().setObjectName(newId.name());
  try {
    DhtReader ctx = (DhtReader) rw.getObjectReader();
    RevObject obj = rw.parseAny(newId);
    ChunkKey oKey = ctx.findChunk(newId);
    if (oKey != null)
      d.getTargetBuilder().setChunkKey(oKey.asString());
    if (obj instanceof RevTag) {
      ObjectId pId = rw.peel(obj);
      ChunkKey pKey = ctx.findChunk(pId);
      if (pKey != null)
        d.getPeeledBuilder().setChunkKey(pKey.asString());
      d.getPeeledBuilder().setObjectName(pId.name());
    }
  } catch (MissingObjectException e) {
    // Automatic peeling failed. Ignore the problem and deal with it
    // during reading later, this is the classical Git behavior on disk.
  }
  return d.build();
}
origin: com.madgag/org.eclipse.jgit.storage.dht

private RefData newData() throws IOException {
  RefData.Builder d = RefData.newBuilder(oldData);
  clearRefData(d);
  updateSequence(d);
  ObjectId newId = getNewObjectId();
  d.getTargetBuilder().setObjectName(newId.name());
  try {
    DhtReader ctx = (DhtReader) rw.getObjectReader();
    RevObject obj = rw.parseAny(newId);
    ChunkKey oKey = ctx.findChunk(newId);
    if (oKey != null)
      d.getTargetBuilder().setChunkKey(oKey.asString());
    if (obj instanceof RevTag) {
      ObjectId pId = rw.peel(obj);
      ChunkKey pKey = ctx.findChunk(pId);
      if (pKey != null)
        d.getPeeledBuilder().setChunkKey(pKey.asString());
      d.getPeeledBuilder().setObjectName(pId.name());
    }
  } catch (MissingObjectException e) {
    // Automatic peeling failed. Ignore the problem and deal with it
    // during reading later, this is the classical Git behavior on disk.
  }
  return d.build();
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
public DhtRefUpdate newUpdate(String refName, boolean detach)
    throws IOException {
  boolean detachingSymbolicRef = false;
  DhtRef ref = getOneRef(refName);
  if (ref == null)
    ref = new DhtObjectIdRef(refName, NONE);
  else
    detachingSymbolicRef = detach && ref.isSymbolic();
  if (detachingSymbolicRef) {
    RefData src = ((DhtRef) ref.getLeaf()).getRefData();
    RefData.Builder b = RefData.newBuilder(ref.getRefData());
    b.clearSymref();
    b.setTarget(src.getTarget());
    ref = new DhtObjectIdRef(refName, b.build());
  }
  RepositoryKey repo = repository.getRepositoryKey();
  DhtRefUpdate update = new DhtRefUpdate(this, repo, db, ref);
  if (detachingSymbolicRef)
    update.setDetachingSymbolicRef();
  return update;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
protected Result doLink(String target) throws IOException {
  try {
    RefData.Builder d = RefData.newBuilder(oldData);
    clearRefData(d);
    updateSequence(d);
    d.setSymref(target);
    newData = d.build();
    boolean r = db.ref().compareAndPut(refKey, oldData, newData);
    if (r) {
      getRefDatabase().stored(dstRef.getName(), newData);
      if (getRef().getStorage() == Ref.Storage.NEW)
        return Result.NEW;
      return Result.FORCED;
    } else {
      getRefDatabase().clearCache();
      return Result.LOCK_FAILURE;
    }
  } catch (TimeoutException e) {
    return Result.IO_FAILURE;
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

@Override
protected Result doLink(String target) throws IOException {
  try {
    RefData.Builder d = RefData.newBuilder(oldData);
    clearRefData(d);
    updateSequence(d);
    d.setSymref(target);
    newData = d.build();
    boolean r = db.ref().compareAndPut(refKey, oldData, newData);
    if (r) {
      getRefDatabase().stored(dstRef.getName(), newData);
      if (getRef().getStorage() == Ref.Storage.NEW)
        return Result.NEW;
      return Result.FORCED;
    } else {
      getRefDatabase().clearCache();
      return Result.LOCK_FAILURE;
    }
  } catch (TimeoutException e) {
    return Result.IO_FAILURE;
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

@Override
public DhtRefUpdate newUpdate(String refName, boolean detach)
    throws IOException {
  boolean detachingSymbolicRef = false;
  DhtRef ref = getOneRef(refName);
  if (ref == null)
    ref = new DhtObjectIdRef(refName, NONE);
  else
    detachingSymbolicRef = detach && ref.isSymbolic();
  if (detachingSymbolicRef) {
    RefData src = ((DhtRef) ref.getLeaf()).getRefData();
    RefData.Builder b = RefData.newBuilder(ref.getRefData());
    b.clearSymref();
    b.setTarget(src.getTarget());
    ref = new DhtObjectIdRef(refName, b.build());
  }
  RepositoryKey repo = repository.getRepositoryKey();
  DhtRefUpdate update = new DhtRefUpdate(this, repo, db, ref);
  if (detachingSymbolicRef)
    update.setDetachingSymbolicRef();
  return update;
}
org.eclipse.jgit.generated.storage.dht.protoGitStore$RefData$Builderbuild

Popular methods of GitStore$RefData$Builder

  • setIsPeeled
  • setSequence
  • setSymref
  • setTarget
  • <init>
  • buildPartial
  • clearIsPeeled
  • clearPeeled
  • clearSymref
  • clearTarget
  • create
  • getParentForChildren
  • create,
  • getParentForChildren,
  • getPeeled,
  • getPeeledBuilder,
  • getPeeledFieldBuilder,
  • getSequence,
  • getTarget,
  • getTargetBuilder,
  • getTargetFieldBuilder

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JTable (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now