new ReverseComparator<Person>(new PersonComparator())
/** * Get the contents of the blob in the commit located at the given path. * * @param repository * @param commitId * @param path * @return contents or null if no blob with path at given commit */ public static String getContent(final Repository repository, final ObjectId commitId, final String path) { return toString(repository, getRawContent(repository, commitId, path)); }
/** * Search the commits starting from the given revision. * * @param start * @return this service */ public CommitFinder findFrom(final String start) { return findBetween(start, (ObjectId) null); }
/** * Search the commits starting at the commit that HEAD current references. * * @return this service */ public CommitFinder find() { return findFrom(HEAD); }
/** * Create a diff filter that affects all the given paths * * @param paths * @return tree filter for diffs affecting given paths */ public static TreeFilter and(final String... paths) { if (paths == null) throw new IllegalArgumentException(Assert.formatNotNull("Paths")); if (paths.length == 0) throw new IllegalArgumentException(Assert.formatNotEmpty("Paths")); return andDiff(paths(paths)); }
/** * Get the HEAD commit in the given repository. * * @param repository * @return commit never null */ public static RevCommit getHead(final Repository repository) { return getCommit(repository, HEAD); }
/** * Get the contents of the blob at the given path in the commit that HEAD * references. * * @param repository * @param path * @return content or null if no blob with path at HEAD commit */ public static String getHeadContent(final Repository repository, final String path) { return getContent(repository, HEAD, path); }
/** * Check if the two given {@link PersonIdent} objects are equal according to * the semantics of {@link #compare(PersonIdent, PersonIdent)}. * * @param p1 * @param p2 * @return true if equal, false otherwise */ public boolean equals(final PersonIdent p1, final PersonIdent p2) { return compare(p1, p2) == 0; }
/** * Find the commit that last changed the given path starting at the commit * that HEAD currently points to * * @param repository * @param path * @return commit */ public static RevCommit getLastCommit(final Repository repository, final String path) { return getLastCommit(repository, HEAD, path); }
/** * Throw an {@link IllegalArgumentException} with a default message if the * {@link Object} array has a length of zero. * * @param objects * @return objects * @throws IllegalArgumentException */ public static <V> V[] notEmpty(final V[] objects) throws IllegalArgumentException { return notEmpty(null, objects); }
/** * List the origin remote references and return all remote references that * are missing locally or have a different remote object id than the local * reference. * * @param repository * @return non-null but possibly empty collection of {@link RefDiff} */ public static Collection<RefDiff> diffOriginRefs(final Repository repository) { return diffRemoteRefs(repository, DEFAULT_REMOTE_NAME); }
/** * Get the id of the blob at the path in the commit that HEAD currently * references. * * @param repository * @param path * @return blob id */ public static ObjectId getHeadId(final Repository repository, final String path) { return getId(repository, HEAD, path); }
/** * Open a stream to the contents of the blob at the path in the commit that * HEAD currently references. * * @param repository * @param path * @return stream */ public static ObjectStream getHeadStream(final Repository repository, final String path) { return getStream(repository, HEAD, path); }
/** * Throw an {@link IllegalArgumentException} with a default message if the * object is null. * * @param object * @return object * @throws IllegalArgumentException */ public static <V> V notNull(final V object) throws IllegalArgumentException { return notNull(null, object); }
/** * Get the raw contents of the blob at the given path in the commit that * HEAD references. * * @param repository * @param path * @return content or null if no blob with path at HEAD commit */ public static byte[] getRawHeadContent(final Repository repository, final String path) { return getRawContent(repository, HEAD, path); }
/** * Get the commit at the tip of the master branch in the given repository. * * @param repository * @return commit never null */ public static RevCommit getMaster(final Repository repository) { return getCommit(repository, MASTER); }
/** * Create a person set filter using a {@link PersonComparator} */ public PersonSetFilter() { this(new PersonComparator()); }
/** * Search the commits starting at HEAD and ending with the given commit id * * @param end * @return this service */ public CommitFinder findUntil(final ObjectId end) { return findBetween(HEAD, end); } }
/** * Throw an {@link IllegalArgumentException} with a default message if the * string has a length of zero. * * @param string * @return string * @throws IllegalArgumentException */ public static String notEmpty(final String string) throws IllegalArgumentException { return notEmpty(null, string); }
/** * Search the commits starting from the given commit id. * * @param start * @return this service */ public CommitFinder findFrom(final ObjectId start) { return findBetween(start, (ObjectId) null); }