mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
[git] simplify readCommits code by inlining convert method
This commit is contained in:
@@ -529,12 +529,14 @@ public class GitHistoryUtils {
|
||||
for (GitLogRecord record : records) {
|
||||
if (record == null) continue;
|
||||
|
||||
Pair<TimedVcsCommit, Collection<VcsRef>> pair = convert(record, factory, root);
|
||||
Hash hash = HashImpl.build(record.getHash());
|
||||
List<Hash> parents = getParentHashes(factory, record);
|
||||
commitConsumer.consume(factory.createTimedCommit(hash, parents, record.getCommitTime()));
|
||||
|
||||
commitConsumer.consume(pair.first);
|
||||
for (VcsRef ref : pair.second) {
|
||||
for (VcsRef ref : parseRefs(record.getRefs(), hash, factory, root)) {
|
||||
refConsumer.consume(ref);
|
||||
}
|
||||
|
||||
userConsumer.consume(factory.createUser(record.getAuthorName(), record.getAuthorEmail()));
|
||||
}
|
||||
}, 1000);
|
||||
@@ -542,16 +544,6 @@ public class GitHistoryUtils {
|
||||
handlerListener.reportErrors();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Pair<TimedVcsCommit, Collection<VcsRef>> convert(@NotNull GitLogRecord rec,
|
||||
@NotNull VcsLogObjectsFactory factory,
|
||||
@NotNull VirtualFile root) {
|
||||
Hash hash = HashImpl.build(rec.getHash());
|
||||
List<Hash> parents = getParentHashes(factory, rec);
|
||||
TimedVcsCommit commit = factory.createTimedCommit(hash, parents, rec.getCommitTime());
|
||||
return Pair.create(commit, parseRefs(rec.getRefs(), hash, factory, root));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Collection<VcsRef> parseRefs(@NotNull Collection<String> refs,
|
||||
@NotNull Hash hash,
|
||||
|
||||
Reference in New Issue
Block a user