Package org.eclipse.jgit.dircache

Examples of org.eclipse.jgit.dircache.DirCache.writeTree()


          for (DirCacheEntry entry : untracked)
            untrackedBuilder.add(entry);
          untrackedBuilder.finish();

          builder.setParentIds(new ObjectId[0]);
          builder.setTreeId(untrackedDirCache.writeTree(inserter));
          builder.setMessage(MessageFormat.format(MSG_UNTRACKED,
              branch, headCommit.abbreviate(7).name(),
              headCommit.getShortMessage()));
          untrackedCommit = inserter.insert(builder);
        }
View Full Code Here


        ObjectInserter odi = repo.newObjectInserter();
        try {
          // Write the index as tree to the object database. This may
          // fail for example when the index contains unmerged paths
          // (unresolved conflicts)
          ObjectId indexTreeId = index.writeTree(odi);

          if (insertChangeId)
            insertChangeId(indexTreeId);

          // Create a Commit object, populate it and write it
View Full Code Here

    b0.add(aSlashCSlashD);
    DirCacheEntry aZeroB = createEntry("a0b", SYMLINK);
    b0.add(aZeroB);
    b0.finish();
    assertEquals(4, tree0.getEntryCount());
    ObjectId tree = tree0.writeTree(oi);

    // Find the directories that were implicitly created above.
    TreeWalk tw = new TreeWalk(or);
    tw.addTree(tree);
    ObjectId a = null;
View Full Code Here

        dcEntry.setObjectId(objectId);
        dcEntry.setFileMode(FileMode.REGULAR_FILE);
        builder.add(dcEntry);

        builder.finish();
        ObjectId treeId = index.writeTree(inserter);

        // Create a Commit object, populate it and write it
        ObjectId headId = repo.resolve(Constants.HEAD + "^{commit}"); //$NON-NLS-1$
        CommitBuilder commit = new CommitBuilder();
        commit.setTreeId(treeId);
View Full Code Here

    for (final DirCacheEntry e : entries)
      b.add(e);
    b.finish();
    ObjectId root;
    try {
      root = dc.writeTree(inserter);
      inserter.flush();
    } finally {
      inserter.release();
    }
    return pool.lookupTree(root);
View Full Code Here

            genSha1(e.getValue()), e.getValue().length());
        editor.add(addEdit);
      }
    }
    editor.finish();
    return lockDirCache.writeTree(db.newObjectInserter());
  }

  ObjectId genSha1(String data) {
    ObjectInserter w = db.newObjectInserter();
    try {
View Full Code Here

    for (final DirCacheEntry e : entries)
      b.add(e);
    b.finish();
    ObjectId root;
    try {
      root = dc.writeTree(inserter);
      inserter.flush();
    } finally {
      inserter.release();
    }
    return pool.lookupTree(root);
View Full Code Here

    aTxtEntry.setFileMode(FileMode.REGULAR_FILE);
    aTxtEntry.setObjectId(aTxt);
    builder.add(aSthEntry);
    builder.add(aTxtEntry);
    builder.finish();
    final ObjectId treeId = dc.writeTree(odi);
    odi.flush();


    final TreeWalk tw = new TreeWalk(db);
    tw.setFilter(PathSuffixFilter.create(".txt"));
View Full Code Here

    bTxtEntry.setFileMode(FileMode.REGULAR_FILE);
    bTxtEntry.setObjectId(bTxt);
    builder.add(bSthEntry);
    builder.add(bTxtEntry);
    builder.finish();
    final ObjectId treeId = dc.writeTree(odi);
    odi.flush();


    final TreeWalk tw = new TreeWalk(db);
    tw.setRecursive(true);
View Full Code Here

        ObjectInserter odi = repo.newObjectInserter();
        try {
          // Write the index as tree to the object database. This may
          // fail for example when the index contains unmerged paths
          // (unresolved conflicts)
          ObjectId indexTreeId = index.writeTree(odi);

          // Create a Commit object, populate it and write it
          Commit commit = new Commit(repo);
          commit.setCommitter(committer);
          commit.setAuthor(author);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.