RepoCommand: Skip RemoteReader when encountering a full SHA-1

There is no point in calling back to the RemoteReader to resolve a
40-digit hex SHA-1 to itself.  We already skip that call when not
ignoring remote failures; skip it when ignoring remote failures, too.

This should simplify RemoteReader implementations.

Reported-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I7566968ed1f39b1ad73574fa903faf3ee308eb87
This commit is contained in:
Jonathan Nieder 2017-11-28 08:16:56 -08:00
parent c213f0a4cd
commit 04b8168beb
1 changed files with 1 additions and 2 deletions

View File

@ -534,8 +534,7 @@ public RevCommit call() throws GitAPIException {
String path = proj.getPath();
String nameUri = proj.getName();
ObjectId objectId;
if (ObjectId.isId(proj.getRevision())
&& !ignoreRemoteFailures) {
if (ObjectId.isId(proj.getRevision())) {
objectId = ObjectId.fromString(proj.getRevision());
} else {
objectId = callback.sha1(nameUri, proj.getRevision());