@Override public boolean next() throws MissingObjectException, IOException { if (idItr.hasNext()) { cur = idItr.next(); if (cur.pack == null) throw new MissingObjectException(cur.id, JGitText.get().unknownObjectType2); sz = cur.pack.getObjectSize(DfsReader.this, cur.offset); return true; } else if (findAllError != null) { throw findAllError; } else { return false; } }
private void verifyClientShallow(Set<ObjectId> shallowCommits) throws IOException, PackProtocolException { AsyncRevObjectQueue q = walk.parseAny(shallowCommits, true); try { for (;;) { try { // Shallow objects named by the client must be commits. RevObject o = q.next(); if (o == null) { break; } if (!(o instanceof RevCommit)) { throw new PackProtocolException( MessageFormat.format( JGitText.get().invalidShallowObject, o.name())); } } catch (MissingObjectException notCommit) { // shallow objects not known at the server are ignored // by git-core upload-pack, match that behavior. shallowCommits.remove(notCommit.getObjectId()); continue; } } } finally { q.release(); } }
} catch (MissingObjectException e) { cmd.setResult(Result.REJECTED_MISSING_OBJECT, e .getMessage()); } catch (IOException e) { cmd.setResult(Result.REJECTED_OTHER_REASON);
e.printStackTrace(); } catch (MissingObjectException e) { e.printStackTrace(); } catch (IncorrectObjectTypeException e) { e.printStackTrace();
any = walk.parseAny(id); } catch (MissingObjectException e) { Activator.logError(e.getMessage(), e); return null; } catch (IOException e) {
@Override void parseHeaders(RevWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (walk.reader.has(this)) flags |= PARSED; else throw new MissingObjectException(this, getType()); }
throw new WantNotValidException(notFound.getObjectId(), notFound); } finally { q.release();
} catch (MissingObjectException e) { cmd.setResult(Result.REJECTED_MISSING_OBJECT, e .getMessage()); } catch (IOException e) { cmd.setResult(Result.REJECTED_OTHER_REASON);
@Override void parseHeaders(RevWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (walk.reader.has(this)) flags |= PARSED; else throw new MissingObjectException(this, getType()); }
errors.getMissingObjects().add(e.getObjectId()); continue; ow.checkConnectivity(); } catch (MissingObjectException e) { errors.getMissingObjects().add(e.getObjectId());
} catch (MissingObjectException e) { cmd.setResult(Result.REJECTED_MISSING_OBJECT, e .getMessage()); } catch (IOException e) { cmd.setResult(Result.REJECTED_OTHER_REASON);
/** {@inheritDoc} */ @Override public long getObjectSize(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException { long sz = db.getObjectSize(this, objectId); if (sz < 0) { if (typeHint == OBJ_ANY) throw new MissingObjectException(objectId.copy(), JGitText.get().unknownObjectType2); throw new MissingObjectException(objectId.copy(), typeHint); } return sz; }
private void checkPacks(ProgressMonitor pm, FsckError errors) throws IOException, FileNotFoundException { try (DfsReader ctx = objdb.newReader()) { for (DfsPackFile pack : objdb.getPacks()) { DfsPackDescription packDesc = pack.getPackDescription(); if (packDesc.getPackSource() == PackSource.UNREACHABLE_GARBAGE) { continue; } try (ReadableChannel rc = objdb.openFile(packDesc, PACK)) { verifyPack(pm, errors, ctx, pack, rc); } catch (MissingObjectException e) { errors.getMissingObjects().add(e.getObjectId()); } catch (CorruptPackIndexException e) { errors.getCorruptIndices().add(new CorruptIndex( pack.getPackDescription().getFileName(INDEX), e.getErrorType())); } } } checkGitModules(pm, errors); }
private long findDeltaBase(ObjectId baseId) throws IOException, MissingObjectException { long ofs = idx().findOffset(baseId); if (ofs < 0) throw new MissingObjectException(baseId, JGitText.get().missingDeltaBase); return ofs; }
&& have.contains(e.getObjectId())) continue; throw e;
private long findDeltaBase(DfsReader ctx, ObjectId baseId) throws IOException, MissingObjectException { long ofs = idx(ctx).findOffset(baseId); if (ofs < 0) throw new MissingObjectException(baseId, JGitText.get().missingDeltaBase); return ofs; }
otp = objectsMap.get(notFound.getObjectId()); if (otp != null && otp.isEdge()) { otp.setDoNotDelta();
private void processBlob(RevObject obj) throws TransportException { try { if (reader.has(obj, Constants.OBJ_BLOB)) obj.add(COMPLETE); else throw new TransportException(MessageFormat.format(JGitText .get().cannotReadBlob, obj.name()), new MissingObjectException(obj, Constants.TYPE_BLOB)); } catch (IOException error) { throw new TransportException(MessageFormat.format( JGitText.get().cannotReadBlob, obj.name()), error); } }
throw new WantNotValidException(notFound.getObjectId(), notFound); } finally {
/** {@inheritDoc} */ @Override public ObjectLoader open(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException { final ObjectLoader ldr = db.openObject(this, objectId); if (ldr == null) { if (typeHint == OBJ_ANY) throw new MissingObjectException(objectId.copy(), JGitText.get().unknownObjectType2); throw new MissingObjectException(objectId.copy(), typeHint); } if (typeHint != OBJ_ANY && ldr.getType() != typeHint) throw new IncorrectObjectTypeException(objectId.copy(), typeHint); return ldr; }