Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -474,18 +474,22 @@ private void throwPathOrBranchNotFound(final FileNotFoundException fileNotFoundE

private GitCommit toGitCommit(final GHCommit ghCommit) throws IOException {
GitCommit commit = commitCache.getIfPresent(ghCommit.getSHA1());
if (commit != null) {
return commit;
} else {

if (commit == null) {
final GHCommit.ShortInfo shortInfo = ghCommit.getCommitShortInfo();
final String author = ghCommit.getAuthor() != null
? ghCommit.getAuthor().getLogin()
: shortInfo.getAuthor().getName();

commit = new GitCommit(
ghCommit.getSHA1(),
ghCommit.getAuthor().getLogin(),
shortInfo.getMessage(),
Instant.ofEpochMilli(shortInfo.getCommitDate().getTime()));
ghCommit.getSHA1(),
author,
shortInfo.getMessage(),
Instant.ofEpochMilli(shortInfo.getCommitDate().getTime()));
commitCache.put(ghCommit.getSHA1(), commit);
return commit;
}

return commit;
}

private <T> T execute(final GHRequest<T> action) throws FlowRegistryException, IOException {
Expand Down
Loading