git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel Cheng (aka SDiZ)" <j16sdiz+freenet@gmail.com>
To: git@vger.kernel.org
Cc: "Daniel Cheng (aka SDiZ)" <j16sdiz+freenet@sdiz.net>
Subject: [PATCH] [JGit] Fix parsing peeled line in packed-ref
Date: Fri,  6 Mar 2009 23:26:15 +0800	[thread overview]
Message-ID: <1236353175-1570-1-git-send-email-j16sdiz+freenet@gmail.com> (raw)

From: Daniel Cheng (aka SDiZ) <j16sdiz+freenet@sdiz.net>

When doing a WalkTransport with packed-ref, peeled
line are not handled correctly. This patch fix the
issue.
---
 .../jgit/transport/WalkRemoteObjectDatabase.java   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java
index a4f8961..d8e727b 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java
@@ -436,7 +436,7 @@ private void readPackedRefsImpl(final Map<String, Ref> avail,
 			if (line.charAt(0) == '^') {
 				if (last == null)
 					throw new TransportException("Peeled line before ref.");
-				final ObjectId id = ObjectId.fromString(line + 1);
+				final ObjectId id = ObjectId.fromString(line.substring(1));
 				last = new Ref(Ref.Storage.PACKED, last.getName(), last
 						.getObjectId(), id, true);
 				avail.put(last.getName(), last);
-- 
1.6.2.rc2

             reply	other threads:[~2009-03-06 15:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06 15:26 Daniel Cheng (aka SDiZ) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-03-06 16:05 [PATCH JGIT] Fix parsing peeled line in packed-ref Daniel Cheng (aka SDiZ)
2009-03-06 16:19 ` Shawn O. Pearce
2009-03-06 15:25 [PATCH] [JGit] " Daniel Cheng (aka SDiZ)
2009-03-06 15:43 ` Shawn O. Pearce

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=1236353175-1570-1-git-send-email-j16sdiz+freenet@gmail.com \
    --to=j16sdiz+freenet@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j16sdiz+freenet@sdiz.net \
    /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;
as well as URLs for NNTP newsgroup(s).