[JGIT PATCH 04/10] Clear the reverse index when closing a PackFile
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Apr 21, 2009, 01:21 UTC
- Message-ID
- <1240276872-17893-5-git-send-email-spearce@spearce.org>
- In-Reply-To
- <1240276872-17893-4-git-send-email-spearce@spearce.org>
We clear the forward index (ObjectId -> offset) when we close the pack, so we might as well clear the reverse index (offset -> ObjectId).
The reverse index is protected by the lock on "this", just like the forward index is.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> --- .../src/org/spearce/jgit/lib/PackFile.java | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java index 1e6f170..b525a82 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java @@ -155,6 +155,7 @@ public void close() { pack.close(); synchronized (this) { loadedIdx = null; + reverseIdx = null; } }
-- 1.6.3.rc1.188.ga02b