[JGIT PATCH 3/3] Use keep(1) instead of add() when skipping an entry
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Sep 11, 2009, 19:58 UTC
- Message-ID
- <1252699129-6961-3-git-send-email-spearce@spearce.org>
- In-Reply-To
- <1252699129-6961-2-git-send-email-spearce@spearce.org>
Doing a keep call with a length of 1 will copy the current entry just like the previous add was doing, but it avoids doing any validation on the entry. This is sane because the entry can be assumed to be already valid, since its originating from the destination index.
Signed-off-by: Shawn O. Pearce <sop@google.com> --- .../jgit/dircache/DirCacheBuildIterator.java | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheBuildIterator.java b/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheBuildIterator.java index 9818b76..94fc071 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheBuildIterator.java +++ b/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheBuildIterator.java @@ -111,7 +111,7 @@ public void skip() throws CorruptObjectException { if (currentSubtree != null) builder.keep(ptr, currentSubtree.getEntrySpan()); else - builder.add(currentEntry); + builder.keep(ptr, 1); next(1); }
-- 1.6.5.rc0.164.g5f6b0