aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Thun2011-04-04 12:04:21 (EDT)
committerPhilipp Thun2011-04-04 12:04:21 (EDT)
commite24005de2d28bf6c246e2ce4e5413ae136920877 (patch)
tree80faf290705440049f772dbbd8c2d171a46ca5ea
parentefad7327ca277f493a2c577866fed75702cd08ed (diff)
downloadjgit-e24005de2d28bf6c246e2ce4e5413ae136920877.zip
jgit-e24005de2d28bf6c246e2ce4e5413ae136920877.tar.gz
jgit-e24005de2d28bf6c246e2ce4e5413ae136920877.tar.bz2
Fix DirCache.isModified()refs/changes/02/3002/1
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>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
index 96173b7..456236c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
@@ -321,7 +321,7 @@ public class DirCache {
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. */