Example usage for org.eclipse.jgit.lib CommitBuilder getParentIds

List of usage examples for org.eclipse.jgit.lib CommitBuilder getParentIds

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib CommitBuilder getParentIds.

Prototype

public ObjectId[] getParentIds() 

Source Link

Document

Get the ancestors of this commit.

Usage

From source file:org.uberfire.java.nio.fs.jgit.util.commands.SubdirectoryClone.java

License:Apache License

private boolean isOrphanCommit(final CommitBuilder commitBuilder) {
    return commitBuilder.getParentIds().length == 0;
}

From source file:org.uberfire.java.nio.fs.jgit.util.commands.SubdirectoryClone.java

License:Apache License

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);
}

From source file:org.uberfire.java.nio.fs.jgit.util.commands.SubdirectoryClone.java

License:Apache License

private boolean isMergeCommit(final CommitBuilder commitBuilder) {
    return commitBuilder.getParentIds().length > 1;
}