/** * A complete ObjectId; null if {@link #isComplete()} is false * * @return a complete ObjectId; null if {@link #isComplete()} is false */ public ObjectId toObjectId() { return isComplete() ? new ObjectId(w1, w2, w3, w4, w5) : null; }
/** {@inheritDoc} */ @Override public Collection<ObjectId> resolve(AbbreviatedObjectId id) throws IOException { if (id.isComplete()) return Collections.singleton(id.toObjectId()); HashSet<ObjectId> matches = new HashSet<>(4); db.resolve(matches, id); return matches; }
private String format(AbbreviatedObjectId id) { if (id.isComplete() && reader != null) { try { id = reader.abbreviate(id.toObjectId(), abbreviationLength); } catch (IOException cannotAbbreviate) { // Ignore this. We'll report the full identity. } } return id.name(); }
/** {@inheritDoc} */ @Override public Collection<ObjectId> resolve(AbbreviatedObjectId id) throws IOException { if (id.isComplete()) return Collections.singleton(id.toObjectId()); HashSet<ObjectId> matches = new HashSet<>(4); PackList packList = db.getPackList(); resolveImpl(packList, id, matches); if (matches.size() < MAX_RESOLVE_MATCHES && packList.dirty()) { stats.scanPacks++; resolveImpl(db.scanPacks(packList), id, matches); } return matches; }
private RawText open(DiffEntry.Side side, DiffEntry entry) throws IOException, BinaryBlobException { if (entry.getMode(side) == FileMode.MISSING) return RawText.EMPTY_TEXT; if (entry.getMode(side).getObjectType() != Constants.OBJ_BLOB) return RawText.EMPTY_TEXT; AbbreviatedObjectId id = entry.getId(side); if (!id.isComplete()) { Collection<ObjectId> ids = reader.resolve(id); if (ids.size() == 1) { id = AbbreviatedObjectId.fromObjectId(ids.iterator().next()); switch (side) { case OLD: entry.oldId = id; break; case NEW: entry.newId = id; break; } } else if (ids.size() == 0) throw new MissingObjectException(id, Constants.OBJ_BLOB); else throw new AmbiguousObjectException(id, ids); } ObjectLoader ldr = LfsFactory.getInstance().applySmudgeFilter(repository, source.open(side, entry), entry.getDiffAttribute()); return RawText.load(ldr, binaryFileThreshold); }
/** @return a complete ObjectId; null if {@link #isComplete()} is false */ public ObjectId toObjectId() { return isComplete() ? new ObjectId(w1, w2, w3, w4, w5) : null; }
/** * A complete ObjectId; null if {@link #isComplete()} is false * * @return a complete ObjectId; null if {@link #isComplete()} is false */ public ObjectId toObjectId() { return isComplete() ? new ObjectId(w1, w2, w3, w4, w5) : null; }
/** {@inheritDoc} */ @Override public Collection<ObjectId> resolve(AbbreviatedObjectId id) throws IOException { if (id.isComplete()) return Collections.singleton(id.toObjectId()); HashSet<ObjectId> matches = new HashSet<>(4); db.resolve(matches, id); return matches; }
@Override public Collection<ObjectId> resolve(AbbreviatedObjectId id) throws IOException { if (id.isComplete()) return Collections.singleton(id.toObjectId()); HashSet<ObjectId> matches = new HashSet<ObjectId>(4); db.resolve(matches, id); return matches; }
private String format(AbbreviatedObjectId id) { if (id.isComplete() && reader != null) { try { id = reader.abbreviate(id.toObjectId(), abbreviationLength); } catch (IOException cannotAbbreviate) { // Ignore this. We'll report the full identity. } } return id.name(); }
private String format(AbbreviatedObjectId id) { if (id.isComplete() && reader != null) { try { id = reader.abbreviate(id.toObjectId(), abbreviationLength); } catch (IOException cannotAbbreviate) { // Ignore this. We'll report the full identity. } } return id.name(); }
/** {@inheritDoc} */ @Override public Collection<ObjectId> resolve(AbbreviatedObjectId id) throws IOException { if (id.isComplete()) return Collections.singleton(id.toObjectId()); HashSet<ObjectId> matches = new HashSet<>(4); PackList packList = db.getPackList(); resolveImpl(packList, id, matches); if (matches.size() < MAX_RESOLVE_MATCHES && packList.dirty()) { stats.scanPacks++; resolveImpl(db.scanPacks(packList), id, matches); } return matches; }
@Override public Collection<ObjectId> resolve(AbbreviatedObjectId id) throws IOException { if (id.isComplete()) return Collections.singleton(id.toObjectId()); boolean noGarbage = avoidUnreachable; HashSet<ObjectId> matches = new HashSet<ObjectId>(4); PackList packList = db.getPackList(); resolveImpl(packList, id, noGarbage, matches); if (matches.size() < MAX_RESOLVE_MATCHES && packList.dirty()) { resolveImpl(db.scanPacks(packList), id, noGarbage, matches); } return matches; }
private RawText open(DiffEntry.Side side, DiffEntry entry) throws IOException, BinaryBlobException { if (entry.getMode(side) == FileMode.MISSING) return RawText.EMPTY_TEXT; if (entry.getMode(side).getObjectType() != Constants.OBJ_BLOB) return RawText.EMPTY_TEXT; AbbreviatedObjectId id = entry.getId(side); if (!id.isComplete()) { Collection<ObjectId> ids = reader.resolve(id); if (ids.size() == 1) { id = AbbreviatedObjectId.fromObjectId(ids.iterator().next()); switch (side) { case OLD: entry.oldId = id; break; case NEW: entry.newId = id; break; } } else if (ids.size() == 0) throw new MissingObjectException(id, Constants.OBJ_BLOB); else throw new AmbiguousObjectException(id, ids); } ObjectLoader ldr = LfsFactory.getInstance().applySmudgeFilter(repository, source.open(side, entry), entry.getDiffAttribute()); return RawText.load(ldr, binaryFileThreshold); }
if (!id.isComplete()) { Collection<ObjectId> ids = reader.resolve(id); if (ids.size() == 1) {
if (!Objects.equal(entry.getOldPath(), entry.getNewPath()) || !Objects.equal(entry.getOldMode(), entry.getNewMode()) || entry.getOldId()==null || !entry.getOldId().isComplete() || entry.getNewId()== null || !entry.getNewId().isComplete() || !entry.getOldId().equals(entry.getNewId())) { diffs.add(entry);