Example usage for org.eclipse.jgit.lib ObjectId compareTo

List of usage examples for org.eclipse.jgit.lib ObjectId compareTo

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib ObjectId compareTo.

Prototype

@Override
public final int compareTo(AnyObjectId other) 

Source Link

Document

Compare this ObjectId to another and obtain a sort ordering.

Usage

From source file:com.google.gerrit.server.query.change.ConflictKey.java

License:Apache License

public ConflictKey(ObjectId commit, ObjectId otherCommit, SubmitType submitType, boolean contentMerge) {
    if (SubmitType.FAST_FORWARD_ONLY.equals(submitType) || commit.compareTo(otherCommit) < 0) {
        this.commit = commit;
        this.otherCommit = otherCommit;
    } else {//from   www . j a va2  s  . com
        this.commit = otherCommit;
        this.otherCommit = commit;
    }
    this.submitType = submitType;
    this.contentMerge = contentMerge;
}