Fix DirCache.isModified()

Change I61a1b45db2d60fdcc0f87373ac6fd75ac4c4a202 fixed a possible NPE
occurring for newly created repositories - but in that case a wrong
value (false = not modified) was returned.

If a current version of the index file exists (liveFile), but there is
no snapshot, this means that there have been modifications (i.e. true
has to be returned).

Change-Id: I698f78112249f9924860fc58eb7eab7afdf87eb7
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
This commit is contained in:
Philipp Thun 2011-04-04 18:04:21 +02:00
parent efad7327ca
commit e24005de2d
1 changed files with 1 additions and 1 deletions

View File

@ -321,7 +321,7 @@ else if (snapshot == null || snapshot.isModified(liveFile)) {
public boolean isOutdated() throws IOException {
if (liveFile == null || !liveFile.exists())
return false;
return snapshot != null && snapshot.isModified(liveFile);
return snapshot == null || snapshot.isModified(liveFile);
}
/** Empty this index, removing all entries. */