private boolean hasImpl(PackList packList, AnyObjectId objectId) throws IOException { for (DfsPackFile pack : packList.packs) { if (pack == last || skipGarbagePack(pack)) continue; if (pack.hasObject(this, objectId)) { last = pack; return true; } } return false; }
/** {@inheritDoc} */ @Override public boolean has(AnyObjectId objectId) throws IOException { if (last != null && !skipGarbagePack(last) && last.hasObject(this, objectId)) return true; PackList packList = db.getPackList(); if (hasImpl(packList, objectId)) { return true; } else if (packList.dirty()) { stats.scanPacks++; return hasImpl(db.scanPacks(packList), objectId); } return false; }
private boolean hasImpl(PackList packList, AnyObjectId objectId, boolean noGarbage) throws IOException { for (DfsPackFile pack : packList.packs) { if (pack == last || (noGarbage && pack.isGarbage())) continue; if (pack.hasObject(this, objectId)) { last = pack; return true; } } return false; }
private boolean hasImpl(PackList packList, AnyObjectId objectId) throws IOException { for (DfsPackFile pack : packList.packs) { if (pack == last || skipGarbagePack(pack)) continue; if (pack.hasObject(this, objectId)) { last = pack; return true; } } return false; }
@Override public boolean has(AnyObjectId objectId) throws IOException { if (last != null && last.hasObject(this, objectId)) return true; boolean noGarbage = avoidUnreachable; PackList packList = db.getPackList(); if (hasImpl(packList, objectId, noGarbage)) { return true; } else if (packList.dirty()) { return hasImpl(db.scanPacks(packList), objectId, noGarbage); } return false; }
/** {@inheritDoc} */ @Override public boolean has(AnyObjectId objectId) throws IOException { if (last != null && !skipGarbagePack(last) && last.hasObject(this, objectId)) return true; PackList packList = db.getPackList(); if (hasImpl(packList, objectId)) { return true; } else if (packList.dirty()) { stats.scanPacks++; return hasImpl(db.scanPacks(packList), objectId); } return false; }