Created
October 1, 2015 12:04
-
-
Save stefanproell/34f8ac3fb5b63599976f to your computer and use it in GitHub Desktop.
Get the most recent commit from a sorted list of commits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get the latest commit before a specified date. | |
* @param execDate | |
* @param path | |
* @return | |
*/ | |
public RevCommit getMostRecentCommit(Date execDate, String path){ | |
TreeMap<DateTime,RevCommit> allCommits = this.getAllCommitsBefore(execDate,path); | |
RevCommit lastCommit = allCommits.lastEntry().getValue(); | |
return lastCommit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment