Package org.eclipse.jgit.dircache

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


        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


        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

        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

        });
      }
      ed.finish();

      ObjectInserter oi = pdb.newObjectInserter();
      ObjectId tree = dc.writeTree(oi);

      final CommitBuilder commit = new CommitBuilder();
      commit.setTreeId(tree);
      commit.setParentIds(new ObjectId[] {currentCommitId});
      commit.setAuthor(author);
View Full Code Here

          }
          builder.add(res);
          i = next;
        }
        builder.finish();
        treeId = dc.writeTree(ins);
      }
      ins.flush();
    } finally {
      ins.release();
    }
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
          CommitBuilder commit = new CommitBuilder();
          commit.setCommitter(committer);
          commit.setAuthor(author);
View Full Code Here

      if (newIndex.getEntryCount() == 0) {
        // nothing to commit
        return false;
      }

      ObjectId treeId = newIndex.writeTree(odi);

      // Create a commit object
      CommitBuilder commit = new CommitBuilder();
      commit.setAuthor(author);
      commit.setCommitter(author);
View Full Code Here

      ObjectId headId = repository.resolve(GB_REFLOG + "^{commit}");
      ObjectInserter odi = repository.newObjectInserter();
      try {
        // Create the in-memory index of the reflog log entry
        DirCache index = createIndex(repository, headId, commands);
        ObjectId indexTreeId = index.writeTree(odi);

        PersonIdent ident;
        if (UserModel.ANONYMOUS.equals(user)) {
          // anonymous push
          ident = new PersonIdent(user.username + "/" + user.username, user.username);
View Full Code Here

    for (String path : paths) {
      DirCacheEntry entry = createEntry(path, FileMode.REGULAR_FILE);
      builder.add(entry);
    }
    builder.finish();
    final ObjectId treeId = dc.writeTree(odi);
    odi.flush();
    return treeId;
  }

  private List<String> getMatchingPaths(String suffixFilter,
View Full Code Here

            .getName());

        // Commit index changes
        CommitBuilder builder = createBuilder();
        builder.setParentId(headCommit);
        builder.setTreeId(cache.writeTree(inserter));
        builder.setMessage(MessageFormat.format(indexMessage, branch,
            headCommit.abbreviate(7).name(),
            headCommit.getShortMessage()));
        ObjectId indexCommit = inserter.insert(builder);
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.