Codota Logo
DirCacheTree.writeTree
Code IndexAdd Codota to your IDE (free)

How to use
writeTree
method
in
org.eclipse.jgit.dircache.DirCacheTree

Best Java code snippets using org.eclipse.jgit.dircache.DirCacheTree.writeTree (Showing top 6 results out of 315)

  • Common ways to obtain DirCacheTree
private void myMethod () {
DirCacheTree d =
  • Codota Iconnew DirCacheTree()
  • Codota IconDirCache dirCache;dirCache.getCacheTree(true)
  • Codota Iconnew DirCacheTree(in, new MutableInteger(), null)
  • Smart code suggestions by Codota
}
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Write all index trees to the object store, returning the root tree.
 *
 * @param ow
 *            the writer to use when serializing to the store. The caller is
 *            responsible for flushing the inserter before trying to use the
 *            returned tree identity.
 * @return identity for the root tree.
 * @throws org.eclipse.jgit.errors.UnmergedPathException
 *             one or more paths contain higher-order stages (stage > 0),
 *             which cannot be stored in a tree object.
 * @throws java.lang.IllegalStateException
 *             one or more paths contain an invalid mode which should never
 *             appear in a tree object.
 * @throws java.io.IOException
 *             an unexpected error occurred writing to the object store.
 */
public ObjectId writeTree(ObjectInserter ow)
    throws UnmergedPathException, IOException {
  return getCacheTree(true).writeTree(sortedEntries, 0, 0, ow);
}
origin: org.eclipse.jgit/org.eclipse.jgit

private int computeSize(final DirCacheEntry[] cache, int cIdx,
    final int pathOffset, final ObjectInserter ow)
    throws UnmergedPathException, IOException {
  final int endIdx = cIdx + entrySpan;
  int childIdx = 0;
  int entryIdx = cIdx;
  int size = 0;
  while (entryIdx < endIdx) {
    final DirCacheEntry e = cache[entryIdx];
    if (e.getStage() != 0)
      throw new UnmergedPathException(e);
    final byte[] ep = e.path;
    if (childIdx < childCnt) {
      final DirCacheTree st = children[childIdx];
      if (st.contains(ep, pathOffset, ep.length)) {
        final int stOffset = pathOffset + st.nameLength() + 1;
        st.writeTree(cache, entryIdx, stOffset, ow);
        size += entrySize(TREE, st.nameLength());
        entryIdx += st.entrySpan;
        childIdx++;
        continue;
      }
    }
    size += entrySize(e.getFileMode(), ep.length - pathOffset);
    entryIdx++;
  }
  return size;
}
origin: sonia.jgit/org.eclipse.jgit

/**
 * Write all index trees to the object store, returning the root tree.
 *
 * @param ow
 *            the writer to use when serializing to the store. The caller is
 *            responsible for flushing the inserter before trying to use the
 *            returned tree identity.
 * @return identity for the root tree.
 * @throws UnmergedPathException
 *             one or more paths contain higher-order stages (stage &gt; 0),
 *             which cannot be stored in a tree object.
 * @throws IllegalStateException
 *             one or more paths contain an invalid mode which should never
 *             appear in a tree object.
 * @throws IOException
 *             an unexpected error occurred writing to the object store.
 */
public ObjectId writeTree(final ObjectInserter ow)
    throws UnmergedPathException, IOException {
  return getCacheTree(true).writeTree(sortedEntries, 0, 0, ow);
}
origin: berlam/github-bucket

/**
 * Write all index trees to the object store, returning the root tree.
 *
 * @param ow
 *            the writer to use when serializing to the store. The caller is
 *            responsible for flushing the inserter before trying to use the
 *            returned tree identity.
 * @return identity for the root tree.
 * @throws org.eclipse.jgit.errors.UnmergedPathException
 *             one or more paths contain higher-order stages (stage &gt; 0),
 *             which cannot be stored in a tree object.
 * @throws java.lang.IllegalStateException
 *             one or more paths contain an invalid mode which should never
 *             appear in a tree object.
 * @throws java.io.IOException
 *             an unexpected error occurred writing to the object store.
 */
public ObjectId writeTree(ObjectInserter ow)
    throws UnmergedPathException, IOException {
  return getCacheTree(true).writeTree(sortedEntries, 0, 0, ow);
}
origin: sonia.jgit/org.eclipse.jgit

private int computeSize(final DirCacheEntry[] cache, int cIdx,
    final int pathOffset, final ObjectInserter ow)
    throws UnmergedPathException, IOException {
  final int endIdx = cIdx + entrySpan;
  int childIdx = 0;
  int entryIdx = cIdx;
  int size = 0;
  while (entryIdx < endIdx) {
    final DirCacheEntry e = cache[entryIdx];
    if (e.getStage() != 0)
      throw new UnmergedPathException(e);
    final byte[] ep = e.path;
    if (childIdx < childCnt) {
      final DirCacheTree st = children[childIdx];
      if (st.contains(ep, pathOffset, ep.length)) {
        final int stOffset = pathOffset + st.nameLength() + 1;
        st.writeTree(cache, entryIdx, stOffset, ow);
        size += entrySize(TREE, st.nameLength());
        entryIdx += st.entrySpan;
        childIdx++;
        continue;
      }
    }
    size += entrySize(e.getFileMode(), ep.length - pathOffset);
    entryIdx++;
  }
  return size;
}
origin: berlam/github-bucket

private int computeSize(final DirCacheEntry[] cache, int cIdx,
    final int pathOffset, final ObjectInserter ow)
    throws UnmergedPathException, IOException {
  final int endIdx = cIdx + entrySpan;
  int childIdx = 0;
  int entryIdx = cIdx;
  int size = 0;
  while (entryIdx < endIdx) {
    final DirCacheEntry e = cache[entryIdx];
    if (e.getStage() != 0)
      throw new UnmergedPathException(e);
    final byte[] ep = e.path;
    if (childIdx < childCnt) {
      final DirCacheTree st = children[childIdx];
      if (st.contains(ep, pathOffset, ep.length)) {
        final int stOffset = pathOffset + st.nameLength() + 1;
        st.writeTree(cache, entryIdx, stOffset, ow);
        size += entrySize(TREE, st.nameLength());
        entryIdx += st.entrySpan;
        childIdx++;
        continue;
      }
    }
    size += entrySize(e.getFileMode(), ep.length - pathOffset);
    entryIdx++;
  }
  return size;
}
org.eclipse.jgit.dircacheDirCacheTreewriteTree

Javadoc

Write (if necessary) this tree to the object store.

Popular methods of DirCacheTree

  • getChild
    Get the i-th child cache tree.
  • getChildCount
    Get the number of cached subtrees contained within this tree.
  • getEntrySpan
    Get the number of entries this tree spans within the DirCache. If this tree is not valid (see #isVal
  • <init>
  • appendName
  • computeSize
  • contains
  • getNameString
    Get the tree's name within its parent. This method is not very efficient and is primarily meant for
  • getObjectId
    Get the tree's ObjectId. If #isValid() returns false this method will return null.
  • insertChild
  • isValid
    Determine if this cache is currently valid. A valid cache tree knows how many org.eclipse.jgit.dirca
  • nameLength
  • isValid,
  • nameLength,
  • namecmp,
  • peq,
  • removeChild,
  • slash,
  • validate,
  • write,
  • getPathString

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now