From 04b8168beb5fb9c7d4e9768cc99a82d0e6176dc2 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 28 Nov 2017 08:16:56 -0800 Subject: [PATCH] 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 --- org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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()); -- 2.39.5