public MetadataDiff compareMetadata(DirCacheEntry entry) {if (entry.isAssumeValid())return MetadataDiff.EQUAL;if (entry.isUpdateNeeded())return MetadataDiff.DIFFER_BY_METADATA;if (isModeDifferent(entry.getRawMode()))return MetadataDiff.DIFFER_BY_METADATA;int type = mode & FileMode.TYPE_MASK;if (type == FileMode.TYPE_TREE || type == FileMode.TYPE_GITLINK)return MetadataDiff.EQUAL;if (!entry.isSmudged() && entry.getLength() != (int) getEntryLength())return MetadataDiff.DIFFER_BY_METADATA;Instant cacheLastModified = entry.getLastModifiedInstant();Instant fileLastModified = getEntryLastModifiedInstant();if (timestampComparator.compare(cacheLastModified, fileLastModified,getOptions().getCheckStat() == CheckStat.MINIMAL) != 0) {return MetadataDiff.DIFFER_BY_TIMESTAMP;}if (entry.isSmudged()) {return MetadataDiff.SMUDGED;}return MetadataDiff.EQUAL;}

public MetadataDiff compareMetadata ( DirCacheEntry entry ) { if ( entry . isAssumeValid ( ) ) return MetadataDiff . EQUAL ; if ( entry . isUpdateNeeded ( ) ) return MetadataDiff . DIFFER_BY_METADATA ; if ( isModeDifferent ( entry . getRawMode ( ) ) ) return MetadataDiff . DIFFER_BY_METADATA ; int type = mode & FileMode . TYPE_MASK ; if ( type == FileMode . TYPE_TREE || type == FileMode . TYPE_GITLINK ) return MetadataDiff . EQUAL ; if ( ! entry . isSmudged ( ) && entry . getLength ( ) != ( int ) getEntryLength ( ) ) return MetadataDiff . DIFFER_BY_METADATA ; Instant cacheLastModified = entry . getLastModifiedInstant ( ) ; Instant fileLastModified = getEntryLastModifiedInstant ( ) ; if ( timestampComparator . compare ( cacheLastModified , fileLastModified , getOptions ( ) . getCheckStat ( ) == CheckStat . MINIMAL ) != 0 ) { return MetadataDiff . DIFFER_BY_TIMESTAMP ; } if ( entry . isSmudged ( ) ) { return MetadataDiff . SMUDGED ; } return MetadataDiff . EQUAL ; }
public virtual WorkingTreeIterator.MetadataDiff CompareMetadata(DirCacheEntry entry){if (entry.IsAssumeValid){return WorkingTreeIterator.MetadataDiff.EQUAL;}if (entry.IsUpdateNeeded){return WorkingTreeIterator.MetadataDiff.DIFFER_BY_METADATA;}if (!entry.IsSmudged && entry.Length != (int)GetEntryLength()){return WorkingTreeIterator.MetadataDiff.DIFFER_BY_METADATA;}if (IsModeDifferent(entry.RawMode)){return WorkingTreeIterator.MetadataDiff.DIFFER_BY_METADATA;}long cacheLastModified = entry.LastModified;long fileLastModified = GetEntryLastModified();if (cacheLastModified % 1000 == 0 || fileLastModified % 1000 == 0){cacheLastModified = cacheLastModified - cacheLastModified % 1000;fileLastModified = fileLastModified - fileLastModified % 1000;}if (fileLastModified != cacheLastModified){return WorkingTreeIterator.MetadataDiff.DIFFER_BY_TIMESTAMP;}else{if (!entry.IsSmudged){return WorkingTreeIterator.MetadataDiff.EQUAL;}else{return WorkingTreeIterator.MetadataDiff.SMUDGED;}}}
