Deprecate Repository#hasObject
Its implementation contains } catch (IOException e) { // Legacy API, assume error means "no" return false; } Better to use ObjectDatabase#has, which throws IOException to report errors. Change-Id: I7de02f7ceb8f57b2a8ebdb16d2aa4376775ff933 Signed-off-by: Jonathan Nieder <jrn@google.com>
This commit is contained in:
parent
d8bb1d09d2
commit
3f9a5ce13f
|
@ -194,13 +194,13 @@ public void testListRemote() throws IOException {
|
|||
@Test
|
||||
public void testInitialClone_Loose() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, remoteURI)) {
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -216,13 +216,13 @@ public void testInitialClone_Packed() throws Exception {
|
|||
new TestRepository<>(remoteRepository).packAndPrune();
|
||||
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, remoteURI)) {
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
|
|
@ -193,14 +193,14 @@ public void testListRemote() throws IOException {
|
|||
@Test
|
||||
public void testInitialClone_Small() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, remoteURI)) {
|
||||
((TransportHttp) t).setUseSmartHttp(false);
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -218,14 +218,14 @@ public void testInitialClone_Packed() throws Exception {
|
|||
new TestRepository<>(remoteRepository).packAndPrune();
|
||||
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, remoteURI)) {
|
||||
((TransportHttp) t).setUseSmartHttp(false);
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ public void testPush_CreateBranch() throws Exception {
|
|||
.singleton(update));
|
||||
}
|
||||
|
||||
assertTrue(remoteRepository.hasObject(Q_txt));
|
||||
assertTrue(remoteRepository.getObjectDatabase().has(Q_txt));
|
||||
assertNotNull("has " + dstName, remoteRepository.exactRef(dstName));
|
||||
assertEquals(Q, remoteRepository.exactRef(dstName).getObjectId());
|
||||
fsck(remoteRepository, Q);
|
||||
|
|
|
@ -275,13 +275,13 @@ public void destroy() {
|
|||
@Test
|
||||
public void testInitialClone_ViaHttps() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, secureURI)) {
|
||||
t.setCredentialsProvider(testCredentials);
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -292,14 +292,14 @@ public void testInitialClone_ViaHttps() throws Exception {
|
|||
@Test
|
||||
public void testInitialClone_RedirectToHttps() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
URIish cloneFrom = extendPath(remoteURI, "/https");
|
||||
try (Transport t = Transport.open(dst, cloneFrom)) {
|
||||
t.setCredentialsProvider(testCredentials);
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -310,7 +310,7 @@ public void testInitialClone_RedirectToHttps() throws Exception {
|
|||
@Test
|
||||
public void testInitialClone_RedirectBackToHttp() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
URIish cloneFrom = extendPath(secureURI, "/back");
|
||||
try (Transport t = Transport.open(dst, cloneFrom)) {
|
||||
|
@ -325,7 +325,7 @@ public void testInitialClone_RedirectBackToHttp() throws Exception {
|
|||
@Test
|
||||
public void testInitialClone_SslFailure() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, secureURI)) {
|
||||
// Set a credentials provider that doesn't handle questions
|
||||
|
|
|
@ -455,13 +455,13 @@ public void testListRemote_BadName() throws IOException, URISyntaxException {
|
|||
@Test
|
||||
public void testInitialClone_Small() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, remoteURI)) {
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -495,7 +495,7 @@ public void testInitialClone_Small() throws Exception {
|
|||
private void initialClone_Redirect(int nofRedirects, int code)
|
||||
throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
URIish cloneFrom = redirectURI;
|
||||
if (code != 301 || nofRedirects > 1) {
|
||||
|
@ -506,7 +506,7 @@ private void initialClone_Redirect(int nofRedirects, int code)
|
|||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -584,7 +584,7 @@ public void testInitialClone_RedirectTooOften() throws Exception {
|
|||
userConfig.setInt("http", null, "maxRedirects", 3);
|
||||
userConfig.save();
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
URIish cloneFrom = extendPath(redirectURI, "/response/4/302");
|
||||
String remoteUri = cloneFrom.toString();
|
||||
|
@ -606,7 +606,7 @@ public void testInitialClone_RedirectTooOften() throws Exception {
|
|||
@Test
|
||||
public void testInitialClone_RedirectLoop() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
URIish cloneFrom = extendPath(redirectURI, "/loop");
|
||||
try (Transport t = Transport.open(dst, cloneFrom)) {
|
||||
|
@ -624,14 +624,14 @@ public void testInitialClone_RedirectOnPostAllowed() throws Exception {
|
|||
userConfig.setString("http", null, "followRedirects", "true");
|
||||
userConfig.save();
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
URIish cloneFrom = extendPath(remoteURI, "/post");
|
||||
try (Transport t = Transport.open(dst, cloneFrom)) {
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -669,7 +669,7 @@ public void testInitialClone_RedirectOnPostAllowed() throws Exception {
|
|||
@Test
|
||||
public void testInitialClone_RedirectOnPostForbidden() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
URIish cloneFrom = extendPath(remoteURI, "/post");
|
||||
try (Transport t = Transport.open(dst, cloneFrom)) {
|
||||
|
@ -688,7 +688,7 @@ public void testInitialClone_RedirectForbidden() throws Exception {
|
|||
userConfig.save();
|
||||
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, redirectURI)) {
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
|
@ -702,14 +702,14 @@ public void testInitialClone_RedirectForbidden() throws Exception {
|
|||
@Test
|
||||
public void testInitialClone_WithAuthentication() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, authURI)) {
|
||||
t.setCredentialsProvider(testCredentials);
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -748,7 +748,7 @@ public void testInitialClone_WithAuthentication() throws Exception {
|
|||
public void testInitialClone_WithAuthenticationNoCredentials()
|
||||
throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, authURI)) {
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
|
@ -770,7 +770,7 @@ public void testInitialClone_WithAuthenticationNoCredentials()
|
|||
public void testInitialClone_WithAuthenticationWrongCredentials()
|
||||
throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, authURI)) {
|
||||
t.setCredentialsProvider(new UsernamePasswordCredentialsProvider(
|
||||
|
@ -796,7 +796,7 @@ public void testInitialClone_WithAuthenticationWrongCredentials()
|
|||
public void testInitialClone_WithAuthenticationAfterRedirect()
|
||||
throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
URIish cloneFrom = extendPath(redirectURI, "/target/auth");
|
||||
CredentialsProvider uriSpecificCredentialsProvider = new UsernamePasswordCredentialsProvider(
|
||||
|
@ -820,7 +820,7 @@ public boolean get(URIish uri, CredentialItem... items)
|
|||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -865,14 +865,14 @@ public boolean get(URIish uri, CredentialItem... items)
|
|||
public void testInitialClone_WithAuthenticationOnPostOnly()
|
||||
throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, authOnPostURI)) {
|
||||
t.setCredentialsProvider(testCredentials);
|
||||
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
|
||||
}
|
||||
|
||||
assertTrue(dst.hasObject(A_txt));
|
||||
assertTrue(dst.getObjectDatabase().has(A_txt));
|
||||
assertEquals(B, dst.exactRef(master).getObjectId());
|
||||
fsck(dst, B);
|
||||
|
||||
|
@ -1042,7 +1042,7 @@ public void testFetch_TooManyLocalCommits() throws Exception {
|
|||
@Test
|
||||
public void testInitialClone_BrokenServer() throws Exception {
|
||||
Repository dst = createBareRepository();
|
||||
assertFalse(dst.hasObject(A_txt));
|
||||
assertFalse(dst.getObjectDatabase().has(A_txt));
|
||||
|
||||
try (Transport t = Transport.open(dst, brokenURI)) {
|
||||
try {
|
||||
|
@ -1201,7 +1201,7 @@ public void testPush_CreateBranch() throws Exception {
|
|||
t.push(NullProgressMonitor.INSTANCE, Collections.singleton(u));
|
||||
}
|
||||
|
||||
assertTrue(remoteRepository.hasObject(Q_txt));
|
||||
assertTrue(remoteRepository.getObjectDatabase().has(Q_txt));
|
||||
assertNotNull("has " + dstName, remoteRepository.exactRef(dstName));
|
||||
assertEquals(Q, remoteRepository.exactRef(dstName).getObjectId());
|
||||
fsck(remoteRepository, Q);
|
||||
|
@ -1275,7 +1275,7 @@ public void testPush_ChunkedEncoding() throws Exception {
|
|||
t.push(NullProgressMonitor.INSTANCE, Collections.singleton(u));
|
||||
}
|
||||
|
||||
assertTrue(remoteRepository.hasObject(Q_bin));
|
||||
assertTrue(remoteRepository.getObjectDatabase().has(Q_bin));
|
||||
assertNotNull("has " + dstName, remoteRepository.exactRef(dstName));
|
||||
assertEquals(Q, remoteRepository.exactRef(dstName).getObjectId());
|
||||
fsck(remoteRepository, Q);
|
||||
|
|
|
@ -66,11 +66,11 @@ public void branch_historyNotPruned() throws Exception {
|
|||
fsTick();
|
||||
gc.prune(Collections.<ObjectId> emptySet());
|
||||
do {
|
||||
assertTrue(repo.hasObject(tip));
|
||||
assertTrue(repo.getObjectDatabase().has(tip));
|
||||
tr.parseBody(tip);
|
||||
RevTree t = tip.getTree();
|
||||
assertTrue(repo.hasObject(t));
|
||||
assertTrue(repo.hasObject(tr.get(t, "a")));
|
||||
assertTrue(repo.getObjectDatabase().has(t));
|
||||
assertTrue(repo.getObjectDatabase().has(tr.get(t, "a")));
|
||||
tip = tip.getParentCount() > 0 ? tip.getParent(0) : null;
|
||||
} while (tip != null);
|
||||
}
|
||||
|
@ -114,6 +114,6 @@ public void deleteMergedBranch_historyNotPruned() throws Exception {
|
|||
gc.setExpireAgeMillis(0);
|
||||
fsTick();
|
||||
gc.prune(Collections.<ObjectId> emptySet());
|
||||
assertTrue(repo.hasObject(b2Tip));
|
||||
assertTrue(repo.getObjectDatabase().has(b2Tip));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public void nonReferencedNonExpiredObject_notPruned() throws Exception {
|
|||
RevBlob a = tr.blob("a");
|
||||
gc.setExpire(new Date(lastModified(a)));
|
||||
gc.prune(Collections.<ObjectId> emptySet());
|
||||
assertTrue(repo.hasObject(a));
|
||||
assertTrue(repo.getObjectDatabase().has(a));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -72,7 +72,7 @@ public void nonReferencedExpiredObject_pruned() throws Exception {
|
|||
gc.setExpireAgeMillis(0);
|
||||
fsTick();
|
||||
gc.prune(Collections.<ObjectId> emptySet());
|
||||
assertFalse(repo.hasObject(a));
|
||||
assertFalse(repo.getObjectDatabase().has(a));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -82,8 +82,8 @@ public void nonReferencedExpiredObjectTree_pruned() throws Exception {
|
|||
gc.setExpireAgeMillis(0);
|
||||
fsTick();
|
||||
gc.prune(Collections.<ObjectId> emptySet());
|
||||
assertFalse(repo.hasObject(t));
|
||||
assertFalse(repo.hasObject(a));
|
||||
assertFalse(repo.getObjectDatabase().has(t));
|
||||
assertFalse(repo.getObjectDatabase().has(a));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -95,8 +95,8 @@ public void nonReferencedObjects_onlyExpiredPruned() throws Exception {
|
|||
RevBlob b = tr.blob("b");
|
||||
|
||||
gc.prune(Collections.<ObjectId> emptySet());
|
||||
assertFalse(repo.hasObject(a));
|
||||
assertTrue(repo.hasObject(b));
|
||||
assertFalse(repo.getObjectDatabase().has(a));
|
||||
assertTrue(repo.getObjectDatabase().has(b));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -60,7 +60,7 @@ public void lightweightTag_objectNotPruned() throws Exception {
|
|||
gc.setExpireAgeMillis(0);
|
||||
fsTick();
|
||||
gc.prune(Collections.<ObjectId> emptySet());
|
||||
assertTrue(repo.hasObject(a));
|
||||
assertTrue(repo.getObjectDatabase().has(a));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -72,7 +72,7 @@ public void annotatedTag_objectNotPruned() throws Exception {
|
|||
gc.setExpireAgeMillis(0);
|
||||
fsTick();
|
||||
gc.prune(Collections.<ObjectId> emptySet());
|
||||
assertTrue(repo.hasObject(t));
|
||||
assertTrue(repo.hasObject(a));
|
||||
assertTrue(repo.getObjectDatabase().has(t));
|
||||
assertTrue(repo.getObjectDatabase().has(a));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ public void testScanningForPackfiles() throws Exception {
|
|||
// scanning of the packs directory
|
||||
ObjectId id = commitFile("file.txt", "test", "master").getId();
|
||||
gc.gc();
|
||||
assertFalse(receivingDB.hasObject(unknownID));
|
||||
assertFalse(receivingDB.getObjectDatabase().has(unknownID));
|
||||
assertTrue(receivingDB.getObjectDatabase().hasPackedObject(id));
|
||||
|
||||
// preparations
|
||||
|
@ -150,7 +150,7 @@ public void testScanningForPackfiles() throws Exception {
|
|||
// JGit will not rescan the packs folder later on and fails to see
|
||||
// the pack file created during gc.
|
||||
assertTrue(tmpFile.createNewFile());
|
||||
assertFalse(receivingDB.hasObject(unknownID));
|
||||
assertFalse(receivingDB.getObjectDatabase().has(unknownID));
|
||||
|
||||
// trigger a gc. This will create packfiles which have likely the
|
||||
// same mtime than the packfolder
|
||||
|
@ -177,8 +177,8 @@ public boolean accept(File dir, String name) {
|
|||
Assume.assumeTrue(tmpFile.lastModified() == ret[0].lastModified());
|
||||
|
||||
// all objects are in a new packfile but we will not detect it
|
||||
assertFalse(receivingDB.hasObject(unknownID));
|
||||
assertTrue(receivingDB.hasObject(id2));
|
||||
assertFalse(receivingDB.getObjectDatabase().has(unknownID));
|
||||
assertTrue(receivingDB.getObjectDatabase().has(id2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ public void testTinyThinPack() throws Exception {
|
|||
public void testPackWithDuplicateBlob() throws Exception {
|
||||
final byte[] data = Constants.encode("0123456789abcdefg");
|
||||
TestRepository<Repository> d = new TestRepository<>(db);
|
||||
assertTrue(db.hasObject(d.blob(data)));
|
||||
assertTrue(db.getObjectDatabase().has(d.blob(data)));
|
||||
|
||||
TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
|
||||
packHeader(pack, 1);
|
||||
|
|
|
@ -236,7 +236,7 @@ public void testSuccess() throws Exception {
|
|||
// Verify the only storage of b is our packed delta above.
|
||||
//
|
||||
ObjectDirectory od = (ObjectDirectory) src.getObjectDatabase();
|
||||
assertTrue("has b", src.hasObject(b));
|
||||
assertTrue("has b", od.has(b));
|
||||
assertFalse("b not loose", od.fileFor(b).exists());
|
||||
|
||||
// Now use b but in a different commit than what is hidden.
|
||||
|
|
|
@ -128,13 +128,13 @@ public UploadPack create(Object req, Repository db)
|
|||
}, null);
|
||||
uri = testProtocol.register(ctx, server);
|
||||
|
||||
assertFalse(client.hasObject(commit0.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(commit0.toObjectId()));
|
||||
|
||||
// Fetch of the parent of the shallow commit
|
||||
try (Transport tn = testProtocol.open(uri, client, "server")) {
|
||||
tn.fetch(NullProgressMonitor.INSTANCE,
|
||||
Collections.singletonList(new RefSpec(commit0.name())));
|
||||
assertTrue(client.hasObject(commit0.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(commit0.toObjectId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ public void testFetchUnreachableBlobWithBitmap() throws Exception {
|
|||
testProtocol = generateReachableCommitUploadPackProtocol();
|
||||
uri = testProtocol.register(ctx, server);
|
||||
|
||||
assertFalse(client.hasObject(blob.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(blob.toObjectId()));
|
||||
|
||||
try (Transport tn = testProtocol.open(uri, client, "server")) {
|
||||
thrown.expect(TransportException.class);
|
||||
|
@ -168,12 +168,12 @@ public void testFetchReachableBlobWithBitmap() throws Exception {
|
|||
testProtocol = generateReachableCommitUploadPackProtocol();
|
||||
uri = testProtocol.register(ctx, server);
|
||||
|
||||
assertFalse(client.hasObject(blob.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(blob.toObjectId()));
|
||||
|
||||
try (Transport tn = testProtocol.open(uri, client, "server")) {
|
||||
tn.fetch(NullProgressMonitor.INSTANCE,
|
||||
Collections.singletonList(new RefSpec(blob.name())));
|
||||
assertTrue(client.hasObject(blob.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(blob.toObjectId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ public void testFetchReachableBlobWithoutBitmap() throws Exception {
|
|||
testProtocol = generateReachableCommitUploadPackProtocol();
|
||||
uri = testProtocol.register(ctx, server);
|
||||
|
||||
assertFalse(client.hasObject(blob.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(blob.toObjectId()));
|
||||
|
||||
try (Transport tn = testProtocol.open(uri, client, "server")) {
|
||||
thrown.expect(TransportException.class);
|
||||
|
@ -227,9 +227,9 @@ public UploadPack create(Object req, Repository db)
|
|||
tn.setFilterBlobLimit(0);
|
||||
tn.fetch(NullProgressMonitor.INSTANCE,
|
||||
Collections.singletonList(new RefSpec(commit.name())));
|
||||
assertTrue(client.hasObject(tree.toObjectId()));
|
||||
assertFalse(client.hasObject(blob1.toObjectId()));
|
||||
assertFalse(client.hasObject(blob2.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(tree.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(blob1.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(blob2.toObjectId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -265,9 +265,9 @@ public UploadPack create(Object req, Repository db)
|
|||
tn.fetch(NullProgressMonitor.INSTANCE, Arrays.asList(
|
||||
new RefSpec(commit.name()),
|
||||
new RefSpec(blob1.name())));
|
||||
assertTrue(client.hasObject(tree.toObjectId()));
|
||||
assertTrue(client.hasObject(blob1.toObjectId()));
|
||||
assertFalse(client.hasObject(blob2.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(tree.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(blob1.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(blob2.toObjectId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -301,8 +301,8 @@ public UploadPack create(Object req, Repository db)
|
|||
tn.setFilterBlobLimit(5);
|
||||
tn.fetch(NullProgressMonitor.INSTANCE,
|
||||
Collections.singletonList(new RefSpec(commit.name())));
|
||||
assertFalse(client.hasObject(longBlob.toObjectId()));
|
||||
assertTrue(client.hasObject(shortBlob.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(longBlob.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(shortBlob.toObjectId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -342,8 +342,8 @@ public UploadPack create(Object req, Repository db)
|
|||
tn.fetch(NullProgressMonitor.INSTANCE, Arrays.asList(
|
||||
new RefSpec(commit.name()),
|
||||
new RefSpec(blob1.name())));
|
||||
assertTrue(client.hasObject(blob1.toObjectId()));
|
||||
assertFalse(client.hasObject(blob2.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(blob1.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(blob2.toObjectId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -381,8 +381,8 @@ public UploadPack create(Object req, Repository db)
|
|||
tn.setFilterBlobLimit(5);
|
||||
tn.fetch(NullProgressMonitor.INSTANCE,
|
||||
Collections.singletonList(new RefSpec(commit.name())));
|
||||
assertFalse(client.hasObject(longBlob.toObjectId()));
|
||||
assertTrue(client.hasObject(shortBlob.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(longBlob.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(shortBlob.toObjectId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -965,10 +965,10 @@ public void testV2FetchServerStopsNegotiation() throws Exception {
|
|||
assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertFalse(client.hasObject(fooParent.toObjectId()));
|
||||
assertTrue(client.hasObject(fooChild.toObjectId()));
|
||||
assertFalse(client.hasObject(barParent.toObjectId()));
|
||||
assertTrue(client.hasObject(barChild.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(fooParent.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(fooChild.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(barParent.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(barChild.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -992,10 +992,10 @@ public void testV2FetchClientStopsNegotiation() throws Exception {
|
|||
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertFalse(client.hasObject(fooParent.toObjectId()));
|
||||
assertTrue(client.hasObject(fooChild.toObjectId()));
|
||||
assertTrue(client.hasObject(barParent.toObjectId()));
|
||||
assertTrue(client.hasObject(barChild.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(fooParent.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(fooChild.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(barParent.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(barChild.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1078,7 +1078,7 @@ public void testV2FetchIncludeTag() throws Exception {
|
|||
PacketLineIn pckIn = new PacketLineIn(recvStream);
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertFalse(client.hasObject(tag.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(tag.toObjectId()));
|
||||
|
||||
// With tag.
|
||||
recvStream = uploadPackV2(
|
||||
|
@ -1091,7 +1091,7 @@ public void testV2FetchIncludeTag() throws Exception {
|
|||
pckIn = new PacketLineIn(recvStream);
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertTrue(client.hasObject(tag.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(tag.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1149,8 +1149,8 @@ public void testV2FetchShallow() throws Exception {
|
|||
PacketLineIn pckIn = new PacketLineIn(recvStream);
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertTrue(client.hasObject(barChild.toObjectId()));
|
||||
assertFalse(client.hasObject(commonParent.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(barChild.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(commonParent.toObjectId()));
|
||||
|
||||
// With shallow, the server knows that we don't have
|
||||
// commonParent, so it sends it.
|
||||
|
@ -1165,7 +1165,7 @@ public void testV2FetchShallow() throws Exception {
|
|||
pckIn = new PacketLineIn(recvStream);
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertTrue(client.hasObject(commonParent.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(commonParent.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1188,8 +1188,8 @@ public void testV2FetchDeepenAndDone() throws Exception {
|
|||
assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertTrue(client.hasObject(child.toObjectId()));
|
||||
assertFalse(client.hasObject(parent.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(child.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(parent.toObjectId()));
|
||||
|
||||
// Without that, the parent is sent too.
|
||||
recvStream = uploadPackV2(
|
||||
|
@ -1201,7 +1201,7 @@ public void testV2FetchDeepenAndDone() throws Exception {
|
|||
pckIn = new PacketLineIn(recvStream);
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertTrue(client.hasObject(parent.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(parent.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1268,15 +1268,15 @@ public void testV2FetchShallowSince() throws Exception {
|
|||
|
||||
// The server does not send this because it is committed
|
||||
// earlier than the given deepen-since time.
|
||||
assertFalse(client.hasObject(tooOld.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(tooOld.toObjectId()));
|
||||
|
||||
// The server does not send this because the client claims to
|
||||
// have it.
|
||||
assertFalse(client.hasObject(boundary.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(boundary.toObjectId()));
|
||||
|
||||
// The server sends both these commits.
|
||||
assertTrue(client.hasObject(beyondBoundary.toObjectId()));
|
||||
assertTrue(client.hasObject(merge.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(beyondBoundary.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(merge.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1316,9 +1316,9 @@ public void testV2FetchShallowSince_excludedParentWithMultipleChildren() throws
|
|||
parsePack(recvStream);
|
||||
|
||||
// Only the children are sent.
|
||||
assertFalse(client.hasObject(base.toObjectId()));
|
||||
assertTrue(client.hasObject(child1.toObjectId()));
|
||||
assertTrue(client.hasObject(child2.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(base.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(child1.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(child2.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1384,16 +1384,16 @@ public void testV2FetchDeepenNot() throws Exception {
|
|||
|
||||
// The server does not send these because they are excluded by
|
||||
// deepen-not.
|
||||
assertFalse(client.hasObject(side.toObjectId()));
|
||||
assertFalse(client.hasObject(one.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(side.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(one.toObjectId()));
|
||||
|
||||
// The server does not send this because the client claims to
|
||||
// have it.
|
||||
assertFalse(client.hasObject(three.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(three.toObjectId()));
|
||||
|
||||
// The server sends both these commits.
|
||||
assertTrue(client.hasObject(merge.toObjectId()));
|
||||
assertTrue(client.hasObject(two.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(merge.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(two.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1441,10 +1441,10 @@ public void testV2FetchDeepenNot_supportAnnotatedTags() throws Exception {
|
|||
assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertFalse(client.hasObject(one.toObjectId()));
|
||||
assertFalse(client.hasObject(two.toObjectId()));
|
||||
assertTrue(client.hasObject(three.toObjectId()));
|
||||
assertTrue(client.hasObject(four.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(one.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(two.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(three.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(four.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1485,9 +1485,9 @@ public void testV2FetchDeepenNot_excludedParentWithMultipleChildren() throws Exc
|
|||
parsePack(recvStream);
|
||||
|
||||
// Only the children are sent.
|
||||
assertFalse(client.hasObject(base.toObjectId()));
|
||||
assertTrue(client.hasObject(child1.toObjectId()));
|
||||
assertTrue(client.hasObject(child2.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(base.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(child1.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(child2.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1538,8 +1538,8 @@ public void testV2FetchFilter() throws Exception {
|
|||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
|
||||
assertFalse(client.hasObject(big.toObjectId()));
|
||||
assertTrue(client.hasObject(small.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(big.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(small.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1610,9 +1610,9 @@ public void testV2FetchWantRef() throws Exception {
|
|||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
|
||||
assertTrue(client.hasObject(one.toObjectId()));
|
||||
assertTrue(client.hasObject(two.toObjectId()));
|
||||
assertFalse(client.hasObject(three.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(one.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(two.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(three.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1666,9 +1666,9 @@ public void testV2FetchMixedWantRef() throws Exception {
|
|||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
|
||||
assertTrue(client.hasObject(one.toObjectId()));
|
||||
assertTrue(client.hasObject(two.toObjectId()));
|
||||
assertFalse(client.hasObject(three.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(one.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(two.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(three.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1699,7 +1699,7 @@ public void testV2FetchWantRefWeAlreadyHave() throws Exception {
|
|||
// ... but the client does not need the object itself.
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertFalse(client.hasObject(one.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(one.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1728,8 +1728,8 @@ public void testV2FetchWantRefAndDeepen() throws Exception {
|
|||
assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
|
||||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
assertTrue(client.hasObject(child.toObjectId()));
|
||||
assertFalse(client.hasObject(parent.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(child.toObjectId()));
|
||||
assertFalse(client.getObjectDatabase().has(parent.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1765,9 +1765,9 @@ public void testV2FetchMissingShallow() throws Exception {
|
|||
assertThat(pckIn.readString(), is("packfile"));
|
||||
parsePack(recvStream);
|
||||
|
||||
assertTrue(client.hasObject(one.toObjectId()));
|
||||
assertTrue(client.hasObject(two.toObjectId()));
|
||||
assertTrue(client.hasObject(three.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(one.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(two.toObjectId()));
|
||||
assertTrue(client.getObjectDatabase().has(three.toObjectId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -193,7 +193,8 @@ private void fetchSubmodules(FetchResult results)
|
|||
// updated to an object that is not currently present in the
|
||||
// submodule.
|
||||
if ((recurseMode == FetchRecurseSubmodulesMode.ON_DEMAND
|
||||
&& !submoduleRepo.hasObject(walk.getObjectId()))
|
||||
&& !submoduleRepo.getObjectDatabase()
|
||||
.has(walk.getObjectId()))
|
||||
|| recurseMode == FetchRecurseSubmodulesMode.YES) {
|
||||
FetchCommand f = new FetchCommand(submoduleRepo)
|
||||
.setProgressMonitor(monitor)
|
||||
|
|
|
@ -319,7 +319,9 @@ public FS getFS() {
|
|||
* a {@link org.eclipse.jgit.lib.AnyObjectId} object.
|
||||
* @return true if the specified object is stored in this repo or any of the
|
||||
* known shared repositories.
|
||||
* @deprecated use {@code getObjectDatabase().has(objectId)}
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean hasObject(AnyObjectId objectId) {
|
||||
try {
|
||||
return getObjectDatabase().has(objectId);
|
||||
|
|
|
@ -338,7 +338,7 @@ private void writePack(final Map<String, RemoteRefUpdate> refUpdates,
|
|||
for (Ref r : getRefs()) {
|
||||
// only add objects that we actually have
|
||||
ObjectId oid = r.getObjectId();
|
||||
if (local.hasObject(oid))
|
||||
if (local.getObjectDatabase().has(oid))
|
||||
remoteObjects.add(oid);
|
||||
}
|
||||
remoteObjects.addAll(additionalHaves);
|
||||
|
|
|
@ -1588,7 +1588,7 @@ private void checkConnectivity() throws IOException {
|
|||
throw new MissingObjectException(o, o.getType());
|
||||
}
|
||||
|
||||
if (o instanceof RevBlob && !db.hasObject(o))
|
||||
if (o instanceof RevBlob && !db.getObjectDatabase().has(o))
|
||||
throw new MissingObjectException(o, Constants.TYPE_BLOB);
|
||||
}
|
||||
checking.endTask();
|
||||
|
|
|
@ -181,7 +181,7 @@ else if (tagopt == TagOpt.FETCH_TAGS)
|
|||
ObjectId id = r.getPeeledObjectId();
|
||||
if (id == null)
|
||||
id = r.getObjectId();
|
||||
if (transport.local.hasObject(id))
|
||||
if (localHasObject(id))
|
||||
wantTag(r);
|
||||
}
|
||||
|
||||
|
@ -393,6 +393,18 @@ private void expandSingle(RefSpec spec, Set<Ref> matched)
|
|||
}
|
||||
}
|
||||
|
||||
private boolean localHasObject(ObjectId id) throws TransportException {
|
||||
try {
|
||||
return transport.local.getObjectDatabase().has(id);
|
||||
} catch (IOException err) {
|
||||
throw new TransportException(
|
||||
MessageFormat.format(
|
||||
JGitText.get().readingObjectsFromLocalRepositoryFailed,
|
||||
err.getMessage()),
|
||||
err);
|
||||
}
|
||||
}
|
||||
|
||||
private Collection<Ref> expandAutoFollowTags() throws TransportException {
|
||||
final Collection<Ref> additionalTags = new ArrayList<>();
|
||||
final Map<String, Ref> haveRefs = localRefs();
|
||||
|
@ -410,7 +422,7 @@ private Collection<Ref> expandAutoFollowTags() throws TransportException {
|
|||
if (obj == null)
|
||||
obj = r.getObjectId();
|
||||
|
||||
if (askFor.containsKey(obj) || transport.local.hasObject(obj))
|
||||
if (askFor.containsKey(obj) || localHasObject(obj))
|
||||
wantTag(r);
|
||||
else
|
||||
additionalTags.add(r);
|
||||
|
|
|
@ -555,10 +555,10 @@ private boolean downloadPackedObject(final ProgressMonitor monitor,
|
|||
continue;
|
||||
} finally {
|
||||
// If the pack was good its in the local repository
|
||||
// and Repository.hasObject(id) will succeed in the
|
||||
// future, so we do not need this data anymore. If
|
||||
// it failed the index and pack are unusable and we
|
||||
// shouldn't consult them again.
|
||||
// and Repository.getObjectDatabase().has(id) will
|
||||
// succeed in the future, so we do not need this
|
||||
// data any more. If it failed the index and pack
|
||||
// are unusable and we shouldn't consult them again.
|
||||
//
|
||||
try {
|
||||
if (pack.tmpIdx != null)
|
||||
|
|
Loading…
Reference in New Issue