From: Jonathan Nieder Date: Tue, 28 Nov 2017 16:16:56 +0000 (-0800) Subject: RepoCommand: Skip RemoteReader when encountering a full SHA-1 X-Git-Tag: v4.10.0.201712302008-r~113 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F67%2F112467%2F1;p=jgit.git 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 Change-Id: I7566968ed1f39b1ad73574fa903faf3ee308eb87 --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java index 219babdf95..422f26be9a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java @@ -534,8 +534,7 @@ public class RepoCommand extends GitCommand { 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());