If a reference was updated more recently than a pack was written
(typical) the PackList was perpetually dirty until the next GC
was completed for the repository.
Detect this condition by observing no changes to the PackList
membership and resetting the dirty bit.
Change-Id: Ie2133aca1f8083307c73b6a26358175864f100ef
return true;
}
+ @Override
+ void clearDirty() {
+ // Always dirty.
+ }
+
@Override
public void markDirty() {
// Always dirty.
p.close();
if (list.isEmpty())
return new PackListImpl(NO_PACKS.packs);
- if (!foundNew)
+ if (!foundNew) {
+ old.clearDirty();
return old;
+ }
return new PackListImpl(list.toArray(new DfsPackFile[list.size()]));
}
}
abstract boolean dirty();
+ abstract void clearDirty();
/**
* Mark pack list as dirty.
return dirty;
}
+ @Override
+ void clearDirty() {
+ dirty = false;
+ }
+
@Override
public void markDirty() {
dirty = true;