]> source.dussan.org Git - jgit.git/commitdiff
RepoCommand: Skip RemoteReader when encountering a full SHA-1 67/112467/1
authorJonathan Nieder <jrn@google.com>
Tue, 28 Nov 2017 16:16:56 +0000 (08:16 -0800)
committerJonathan Nieder <jrn@google.com>
Tue, 28 Nov 2017 16:17:04 +0000 (08:17 -0800)
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

org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java

index 219babdf95bd2432c1e9e66db766f7ba3c37c736..422f26be9a683300c406725cda2ef7f69a04215f 100644 (file)
@@ -534,8 +534,7 @@ public class RepoCommand extends GitCommand<RevCommit> {
                                        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());