summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-12-07 18:42:10 -0800
committerShawn O. Pearce <spearce@spearce.org>2010-12-08 10:03:20 -0800
commitca9baa0ee2d86edf1c1e29ba3c35ba45fcf32b8c (patch)
treed750b13055e54d38c7f0f21bc8b2f5788286b1f2 /org.eclipse.jgit/src
parentf4e9c8890cc625ba57b5a3cd078ca14cbcc86f8b (diff)
downloadjgit-ca9baa0ee2d86edf1c1e29ba3c35ba45fcf32b8c.tar.gz
jgit-ca9baa0ee2d86edf1c1e29ba3c35ba45fcf32b8c.zip
IndexDiff: Always use TreeWalk.getPathString()
Instead of asking the individual iterators for their path string, use the TreeWalk's generic getPathString() method. Its just as fast because it uses the path of the current matching iterator. Change-Id: I9b827fbbafce1c78f09d5527cdc64fbe9022a16e Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
index a65753d1c9..489e5c0cee 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
@@ -195,7 +195,7 @@ public class IndexDiff {
if (dirCacheIterator != null) {
if (dirCacheIterator.getDirCacheEntry().isAssumeValid())
- assumeUnchanged.add(dirCacheIterator.getEntryPathString());
+ assumeUnchanged.add(treeWalk.getPathString());
}
if (treeIterator != null) {
@@ -203,29 +203,28 @@ public class IndexDiff {
if (!treeIterator.getEntryObjectId().equals(
dirCacheIterator.getEntryObjectId())) {
// in repo, in index, content diff => changed
- changed.add(dirCacheIterator.getEntryPathString());
+ changed.add(treeWalk.getPathString());
changesExist = true;
}
} else {
// in repo, not in index => removed
if (!fileModeTree.equals(FileMode.TYPE_TREE)) {
- removed.add(treeIterator.getEntryPathString());
+ removed.add(treeWalk.getPathString());
changesExist = true;
if (workingTreeIterator != null)
- untracked.add(workingTreeIterator
- .getEntryPathString());
+ untracked.add(treeWalk.getPathString());
}
}
} else {
if (dirCacheIterator != null) {
// not in repo, in index => added
- added.add(dirCacheIterator.getEntryPathString());
+ added.add(treeWalk.getPathString());
changesExist = true;
} else {
// not in repo, not in index => untracked
if (workingTreeIterator != null
&& !workingTreeIterator.isEntryIgnored()) {
- untracked.add(workingTreeIterator.getEntryPathString());
+ untracked.add(treeWalk.getPathString());
changesExist = true;
}
}
@@ -234,12 +233,12 @@ public class IndexDiff {
if (dirCacheIterator != null) {
if (workingTreeIterator == null) {
// in index, not in workdir => missing
- missing.add(dirCacheIterator.getEntryPathString());
+ missing.add(treeWalk.getPathString());
changesExist = true;
} else {
if (!dirCacheIterator.idEqual(workingTreeIterator)) {
// in index, in workdir, content differs => modified
- modified.add(dirCacheIterator.getEntryPathString());
+ modified.add(treeWalk.getPathString());
changesExist = true;
}
}