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

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

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

origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

com.google.protobuf.UnknownFieldSet.Builder unknownFields =
 com.google.protobuf.UnknownFieldSet.newBuilder(
  this.getUnknownFields());
while (true) {
 int tag = input.readTag();
 switch (tag) {
  case 0:
   this.setUnknownFields(unknownFields.build());
   onChanged();
   return this;
  default: {
   if (!parseUnknownField(input, unknownFields,
               extensionRegistry, tag)) {
    this.setUnknownFields(unknownFields.build());
    onChanged();
    return this;
   if (hasTarget()) {
    subBuilder.mergeFrom(getTarget());
   setTarget(subBuilder.buildPartial());
   break;
   if (hasPeeled()) {
    subBuilder.mergeFrom(getPeeled());
   setPeeled(subBuilder.buildPartial());
   break;
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

com.google.protobuf.UnknownFieldSet.Builder unknownFields =
 com.google.protobuf.UnknownFieldSet.newBuilder(
  this.getUnknownFields());
while (true) {
 int tag = input.readTag();
 switch (tag) {
  case 0:
   this.setUnknownFields(unknownFields.build());
   onChanged();
   return this;
  default: {
   if (!parseUnknownField(input, unknownFields,
               extensionRegistry, tag)) {
    this.setUnknownFields(unknownFields.build());
    onChanged();
    return this;
   if (hasTarget()) {
    subBuilder.mergeFrom(getTarget());
   setTarget(subBuilder.buildPartial());
   break;
   if (hasPeeled()) {
    subBuilder.mergeFrom(getPeeled());
   setPeeled(subBuilder.buildPartial());
   break;
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;
}
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

public Builder mergeFrom(org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData other) {
 if (other == org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData.getDefaultInstance()) return this;
 if (other.hasSequence()) {
  setSequence(other.getSequence());
 }
 if (other.hasSymref()) {
  setSymref(other.getSymref());
 }
 if (other.hasTarget()) {
  mergeTarget(other.getTarget());
 }
 if (other.hasIsPeeled()) {
  setIsPeeled(other.getIsPeeled());
 }
 if (other.hasPeeled()) {
  mergePeeled(other.getPeeled());
 }
 this.mergeUnknownFields(other.getUnknownFields());
 return this;
}
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

public Builder mergeFrom(org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData other) {
 if (other == org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData.getDefaultInstance()) return this;
 if (other.hasSequence()) {
  setSequence(other.getSequence());
 }
 if (other.hasSymref()) {
  setSymref(other.getSymref());
 }
 if (other.hasTarget()) {
  mergeTarget(other.getTarget());
 }
 if (other.hasIsPeeled()) {
  setIsPeeled(other.getIsPeeled());
 }
 if (other.hasPeeled()) {
  mergePeeled(other.getPeeled());
 }
 this.mergeUnknownFields(other.getUnknownFields());
 return this;
}
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

public Builder clone() {
 return create().mergeFrom(buildPartial());
}
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

public Builder clone() {
 return create().mergeFrom(buildPartial());
}
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

private static Builder create() {
 return new Builder();
}
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

private static Builder create() {
 return new Builder();
}
origin: com.madgag/org.eclipse.jgit.storage.dht

  private static void updateSequence(RefData.Builder d) {
    d.setSequence(d.getSequence() + 1);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

  private static void updateSequence(RefData.Builder d) {
    d.setSequence(d.getSequence() + 1);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

private org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData buildParsed()
  throws com.google.protobuf.InvalidProtocolBufferException {
 org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData result = buildPartial();
 if (!result.isInitialized()) {
  throw newUninitializedMessageException(
   result).asInvalidProtocolBufferException();
 }
 return result;
}
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

private org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData buildParsed()
  throws com.google.protobuf.InvalidProtocolBufferException {
 org.eclipse.jgit.generated.storage.dht.proto.GitStore.RefData result = buildPartial();
 if (!result.isInitialized()) {
  throw newUninitializedMessageException(
   result).asInvalidProtocolBufferException();
 }
 return result;
}
org.eclipse.jgit.generated.storage.dht.protoGitStore$RefData$Builder

Most used methods

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

Popular in Java

  • Updating database using SQL prepared statement
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • JPanel (javax.swing)
  • Top 12 Jupyter Notebook extensions
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