Git development
 help / color / mirror / Atom feed
From: Grzegorz Kossakowski <grek@tuffmail.com>
To: git@vger.kernel.org
Cc: Grzegorz Kossakowski <grek@google.com>
Subject: [PATCH 1/2] Throw IllegalStateException if DirCacheEntry has not been fully initialized.
Date: Tue, 11 Aug 2009 17:56:20 -0700	[thread overview]
Message-ID: <1250038581-31241-1-git-send-email-grek@tuffmail.com> (raw)

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

             reply	other threads:[~2009-08-12  0:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12  0:56 Grzegorz Kossakowski [this message]
2009-08-12  0:56 ` [PATCH 2/2] Add PathSuffixFilter class which is TreeFilter Grzegorz Kossakowski
2009-08-12  0:58   ` Grzegorz Kossakowski
2009-08-12  1:04 ` [PATCH 1/2] Throw IllegalStateException if DirCacheEntry has not been fully initialized Johannes Schindelin
2009-08-12  1:15   ` Grzegorz Kossakowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1250038581-31241-1-git-send-email-grek@tuffmail.com \
    --to=grek@tuffmail.com \
    --cc=git@vger.kernel.org \
    --cc=grek@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox