summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java11
2 files changed, 12 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
index 05cd100953..62206c69c9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
@@ -115,6 +115,10 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex {
JGitText.get().badObjectType, String.valueOf(type)));
}
}
+ commits.trim();
+ trees.trim();
+ blobs.trim();
+ tags.trim();
}
private ObjectToPack[] sortByOffset(List<ObjectToPack> entries) {
@@ -168,6 +172,7 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex {
*/
public void addBitmap(
AnyObjectId objectId, EWAHCompressedBitmap bitmap, int flags) {
+ bitmap.trim();
StoredBitmap result = new StoredBitmap(objectId, bitmap, null, flags);
getBitmaps().add(result);
byAddOrder.add(result);
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 d7c93d1a1c..73ab04f9cb 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
@@ -596,7 +596,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
* a relevant ignore rule file exists but cannot be read.
*/
protected boolean isEntryIgnored(final int pLen) throws IOException {
- return isEntryIgnored(pLen, false);
+ return isEntryIgnored(pLen, mode, false);
}
/**
@@ -605,13 +605,16 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
*
* @param pLen
* the length of the path in the path buffer.
+ * @param fileMode
+ * the original iterator file mode
* @param negatePrevious
* true if the previous matching iterator rule was negation
* @return true if the entry is ignored by an ignore rule.
* @throws IOException
* a relevant ignore rule file exists but cannot be read.
*/
- private boolean isEntryIgnored(final int pLen, boolean negatePrevious)
+ private boolean isEntryIgnored(final int pLen, int fileMode,
+ boolean negatePrevious)
throws IOException {
IgnoreNode rules = getIgnoreNode();
if (rules != null) {
@@ -623,7 +626,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
if (0 < pOff)
pOff--;
String p = TreeWalk.pathOf(path, pOff, pLen);
- switch (rules.isIgnored(p, FileMode.TREE.equals(mode),
+ switch (rules.isIgnored(p, FileMode.TREE.equals(fileMode),
negatePrevious)) {
case IGNORED:
return true;
@@ -638,7 +641,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
}
}
if (parent instanceof WorkingTreeIterator)
- return ((WorkingTreeIterator) parent).isEntryIgnored(pLen,
+ return ((WorkingTreeIterator) parent).isEntryIgnored(pLen, fileMode,
negatePrevious);
return false;
}