.format(JGitText.get().cannotReadCommit, p.name()),
err);
}
}
if (!missing.isEmpty())
throw new MissingBundlePrerequisiteException(transport.uri,
missing);
Map<String, Ref> localRefs;
try {
localRefs = transport.local.getRefDatabase().getRefs(ALL);
} catch (IOException e) {
throw new TransportException(transport.uri, e.getMessage(), e);
}
for (final Ref r : localRefs.values()) {
try {
rw.markStart(rw.parseCommit(r.getObjectId()));
} catch (IOException readError) {
// If we cannot read the value of the ref skip it.
}
}
int remaining = commits.size();
try {
RevCommit c;
while ((c = rw.next()) != null) {
if (c.has(PREREQ)) {
c.add(SEEN);
if (--remaining == 0)
break;
}
}
} catch (IOException err) {
throw new TransportException(transport.uri,
JGitText.get().cannotReadObject, err);
}
if (remaining > 0) {
for (final RevObject o : commits) {
if (!o.has(SEEN))
missing.put(o, prereqs.get(o));
}
throw new MissingBundlePrerequisiteException(transport.uri,
missing);
}
} finally {
rw.release();
}