summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.java7.test/src/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java9
2 files changed, 9 insertions, 6 deletions
diff --git a/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java
index 484467b24c..2b2d65e9b1 100644
--- a/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java
+++ b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java
@@ -114,7 +114,8 @@ public class FileTreeIteratorJava7Test extends RepositoryTestCase {
assertEquals("link", dci.getEntryPathString());
// test
- assertFalse(fti.isModified(dci.getDirCacheEntry(), true));
+ assertFalse(fti.isModified(dci.getDirCacheEntry(), true,
+ db.newObjectReader()));
}
/**
@@ -195,6 +196,7 @@ public class FileTreeIteratorJava7Test extends RepositoryTestCase {
assertEquals("link", dci.getEntryPathString());
// test
- assertTrue(fti.isModified(dci.getDirCacheEntry(), true));
+ assertTrue(fti.isModified(dci.getDirCacheEntry(), true,
+ db.newObjectReader()));
}
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
index 633865ed4d..dd59afc389 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
@@ -922,7 +922,8 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
} else {
if (mode == FileMode.SYMLINK.getBits())
return !new File(readContentAsNormalizedString(current()))
- .equals(new File((readContentAsNormalizedString(entry))));
+ .equals(new File((readContentAsNormalizedString(entry,
+ reader))));
// Content differs: that's a real change, perhaps
if (reader == null) // deprecated use, do no further checks
return true;
@@ -971,9 +972,9 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
}
}
- private String readContentAsNormalizedString(DirCacheEntry entry)
- throws MissingObjectException, IOException {
- ObjectLoader open = repository.open(entry.getObjectId());
+ private static String readContentAsNormalizedString(DirCacheEntry entry,
+ ObjectReader reader) throws MissingObjectException, IOException {
+ ObjectLoader open = reader.open(entry.getObjectId());
byte[] cachedBytes = open.getCachedBytes();
return FS.detect().normalize(RawParseUtils.decode(cachedBytes));
}