/** * Check whether this entry has been smudged or not * <p> * If a blob has length 0 we know its id, see * {@link org.eclipse.jgit.lib.Constants#EMPTY_BLOB_ID}. If an entry has * length 0 and an ID different from the one for empty blob we know this * entry was smudged. * * @return <code>true</code> if the entry is smudged, <code>false</code> * otherwise */ public final boolean isSmudged() { final int base = infoOffset + P_OBJECTID; return (getLength() == 0) && (Constants.EMPTY_BLOB_ID.compareTo(info, base) != 0); }
/** * {@inheritDoc} * <p> * Use for debugging only ! */ @SuppressWarnings("nls") @Override public String toString() { return getFileMode() + " " + getLength() + " " + getLastModified() + " " + getObjectId() + " " + getStage() + " " + getPathString() + "\n"; }
/** * adds a entry to the index builder which is a copy of the specified * DirCacheEntry * * @param e * the entry which should be copied * * @return the entry which was added to the index */ private DirCacheEntry keep(DirCacheEntry e) { DirCacheEntry newEntry = new DirCacheEntry(e.getRawPath(), e.getStage()); newEntry.setFileMode(e.getFileMode()); newEntry.setObjectId(e.getObjectId()); newEntry.setLastModified(e.getLastModified()); newEntry.setLength(e.getLength()); builder.add(newEntry); return newEntry; }
return MetadataDiff.EQUAL; if (!entry.isSmudged() && entry.getLength() != (int) getEntryLength()) return MetadataDiff.DIFFER_BY_METADATA;
/** * Check whether this entry has been smudged or not * <p> * If a blob has length 0 we know its id, see * {@link org.eclipse.jgit.lib.Constants#EMPTY_BLOB_ID}. If an entry has * length 0 and an ID different from the one for empty blob we know this * entry was smudged. * * @return <code>true</code> if the entry is smudged, <code>false</code> * otherwise */ public final boolean isSmudged() { final int base = infoOffset + P_OBJECTID; return (getLength() == 0) && (Constants.EMPTY_BLOB_ID.compareTo(info, base) != 0); }
/** * Check whether this entry has been smudged or not * <p> * If a blob has length 0 we know his id see {@link Constants#EMPTY_BLOB_ID}. If an entry * has length 0 and an ID different from the one for empty blob we know this * entry was smudged. * * @return <code>true</code> if the entry is smudged, <code>false</code> * otherwise */ public final boolean isSmudged() { final int base = infoOffset + P_OBJECTID; return (getLength() == 0) && (Constants.EMPTY_BLOB_ID.compareTo(info, base) != 0); }
DirCacheEntry indexEntry = dcIter.getDirCacheEntry(); entry.setLastModified(indexEntry.getLastModified()); entry.setLength(indexEntry.getLength());
DirCacheEntry indexEntry = dcIter.getDirCacheEntry(); entry.setLastModified(indexEntry.getLastModified()); entry.setLength(indexEntry.getLength());
/** * {@inheritDoc} * <p> * Use for debugging only ! */ @SuppressWarnings("nls") @Override public String toString() { return getFileMode() + " " + getLength() + " " + getLastModified() + " " + getObjectId() + " " + getStage() + " " + getPathString() + "\n"; }
/** * Use for debugging only ! */ @SuppressWarnings("nls") @Override public String toString() { return getFileMode() + " " + getLength() + " " + getLastModified() + " " + getObjectId() + " " + getStage() + " " + getPathString() + "\n"; }
final DirCacheEntry ent = cache.getEntry(i); final FileMode mode = FileMode.fromBits(ent.getRawMode()); final int len = ent.getLength(); long lastModified = ent.getLastModified(); final Date mtime = new Date(lastModified);
private static void assertCacheEntryEquals(DirCacheEntry expected, DirCacheEntry actual, String header, int index) { try { assertEquals("fileMode", expected.getFileMode(), actual.getFileMode()); assertEquals("length", expected.getLength(), actual.getLength()); assertEquals("objectId", expected.getObjectId(), actual.getObjectId()); assertEquals("stage", expected.getStage(), actual.getStage()); assertEquals("path", expected.getPathString(), actual.getPathString()); } catch(AssertionError e) { fail(header + "caches first differed at entry [" + index + "]; " + e.getMessage()); } }
/** * adds a entry to the index builder which is a copy of the specified * DirCacheEntry * * @param e * the entry which should be copied * * @return the entry which was added to the index */ private DirCacheEntry keep(DirCacheEntry e) { DirCacheEntry newEntry = new DirCacheEntry(e.getRawPath(), e.getStage()); newEntry.setFileMode(e.getFileMode()); newEntry.setObjectId(e.getObjectId()); newEntry.setLastModified(e.getLastModified()); newEntry.setLength(e.getLength()); builder.add(newEntry); return newEntry; }
/** * adds a entry to the index builder which is a copy of the specified * DirCacheEntry * * @param e * the entry which should be copied * * @return the entry which was added to the index */ private DirCacheEntry keep(DirCacheEntry e) { DirCacheEntry newEntry = new DirCacheEntry(e.getPathString(), e.getStage()); newEntry.setFileMode(e.getFileMode()); newEntry.setObjectId(e.getObjectId()); newEntry.setLastModified(e.getLastModified()); newEntry.setLength(e.getLength()); builder.add(newEntry); return newEntry; }
return MetadataDiff.EQUAL; if (!entry.isSmudged() && entry.getLength() != (int) getEntryLength()) return MetadataDiff.DIFFER_BY_METADATA;
return MetadataDiff.EQUAL; if (!entry.isSmudged() && entry.getLength() != (int) getEntryLength()) return MetadataDiff.DIFFER_BY_METADATA;
DirCacheEntry indexEntry = dcIter.getDirCacheEntry(); entry.setLastModified(indexEntry.getLastModified()); entry.setLength(indexEntry.getLength());
DirCacheEntry indexEntry = dcIter.getDirCacheEntry(); entry.setLastModified(indexEntry.getLastModified()); entry.setLength(indexEntry.getLength());
DirCacheEntry indexEntry = dcIter.getDirCacheEntry(); entry.setLastModified(indexEntry.getLastModified()); entry.setLength(indexEntry.getLength());
DirCacheEntry indexEntry = dcIter.getDirCacheEntry(); entry.setLastModified(indexEntry.getLastModified()); entry.setLength(indexEntry.getLength());