git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] Throw IllegalStateException if DirCacheEntry has not been fully initialized.

From
Grzegorz Kossakowski <grek@tuffmail.com>
Date
Aug 12, 2009, 00:56 UTC
Message-ID
<1250038581-31241-1-git-send-email-grek@tuffmail.com>
From: Grzegorz Kossakowski <grek@google.com>

When mode's object type of entry equals to Constants.OBJ_BAD it's a sign of bad (uninitialized) state of an entry and not of problems with merging.

Signed-off-by: Grzegorz Kossakowski <grek@google.com>
---
 .../org/spearce/jgit/dircache/DirCacheTree.java    |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheTree.java b/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheTree.java
index 9d5af70..79e95cb 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheTree.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheTree.java
@@ -377,7 +377,8 @@ private int computeSize(final DirCacheEntry[] cache, int cIdx,
 
 			final FileMode mode = e.getFileMode();
 			if (mode.getObjectType() == Constants.OBJ_BAD)
-				throw new UnmergedPathException(e);
+				throw new IllegalStateException("Entry \"" + e.getPathString()
+						+ "\" has incorrect mode set up.");
 
 			size += mode.copyToLength();
 			size += ep.length - pathOffset;
-- 
1.6.3.3
Next: Grzegorz Kossakowski
Message 1 of 5 in “Throw IllegalStateException if DirCacheEntry has not been fully initialized.”
  1. 1/2 Throw IllegalStateException if DirCacheEntry has not been fully initialized.Grzegorz Kossakowski, Aug 12, 2009
  2. 2/2 Add PathSuffixFilter class which is TreeFilter.Grzegorz Kossakowski, Aug 12, 2009
  3. Grzegorz KossakowskiAug 12, 2009
  4. Johannes SchindelinAug 12, 2009
  5. Grzegorz KossakowskiAug 12, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.