os.write(htree); os.write(' '); getTreeId().copyTo(os); os.write('\n');
private boolean apply(List<Command> todo) throws IOException { if (!tree.apply(todo)) { // apply set rejection information on commands. return false; } Repository repo = refdb.getRepository(); try (ObjectInserter ins = repo.newObjectInserter()) { CommitBuilder b = new CommitBuilder(); b.setTreeId(tree.writeTree(ins)); if (parentTreeId.equals(b.getTreeId())) { for (Command c : todo) { c.setResult(OK); } return true; } if (!parentCommitId.equals(ObjectId.zeroId())) { b.setParentId(parentCommitId); } author = getRefLogIdent(); if (author == null) { author = new PersonIdent(repo); } b.setAuthor(author); b.setCommitter(author); b.setMessage(getRefLogMessage()); newCommitId = ins.insert(b); ins.flush(); } return true; }
os.write(htree); os.write(' '); getTreeId().copyTo(os); os.write('\n');
os.write(htree); os.write(' '); getTreeId().copyTo(os); os.write('\n');
private boolean isDifferentFromParent(final RevWalk revWalk, final CommitBuilder commitBuilder) throws MissingObjectException, IncorrectObjectTypeException, IOException { final ObjectId parentId = commitBuilder.getParentIds()[0]; final RevCommit parentCommit = revWalk.parseCommit(parentId); final ObjectId parentTreeId = parentCommit.getTree().getId(); final ObjectId commitTreeId = commitBuilder.getTreeId(); // A commit with the same tree as its parent has no changes. return !commitTreeId.equals(parentTreeId); }
TimeZone.getDefault())); b.setCommitter(b.getAuthor()); if (b.getTreeId().equals(oldTreeId)) { return;
private boolean apply(List<Command> todo) throws IOException { if (!tree.apply(todo)) { // apply set rejection information on commands. return false; } Repository repo = refdb.getRepository(); try (ObjectInserter ins = repo.newObjectInserter()) { CommitBuilder b = new CommitBuilder(); b.setTreeId(tree.writeTree(ins)); if (parentTreeId.equals(b.getTreeId())) { for (Command c : todo) { c.setResult(OK); } return true; } if (!parentCommitId.equals(ObjectId.zeroId())) { b.setParentId(parentCommitId); } author = getRefLogIdent(); if (author == null) { author = new PersonIdent(repo); } b.setAuthor(author); b.setCommitter(author); b.setMessage(getRefLogMessage()); newCommitId = ins.insert(b); ins.flush(); } return true; }
private boolean apply(List<Command> todo) throws IOException { if (!tree.apply(todo)) { // apply set rejection information on commands. return false; } Repository repo = refdb.getRepository(); try (ObjectInserter ins = repo.newObjectInserter()) { CommitBuilder b = new CommitBuilder(); b.setTreeId(tree.writeTree(ins)); if (parentTreeId.equals(b.getTreeId())) { for (Command c : todo) { c.setResult(OK); } return true; } if (!parentCommitId.equals(ObjectId.zeroId())) { b.setParentId(parentCommitId); } author = getRefLogIdent(); if (author == null) { author = new PersonIdent(repo); } b.setAuthor(author); b.setCommitter(author); b.setMessage(getRefLogMessage()); newCommitId = ins.insert(b); ins.flush(); } return true; }