git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: "Daniel Cheng (aka SDiZ)" <j16sdiz+freenet@gmail.com>
Cc: git@vger.kernel.org,
	"Daniel Cheng (aka SDiZ)" <j16sdiz+freenet@sdiz.net>
Subject: Re: [PATCH] [JGit] Fix parsing peeled line in packed-ref
Date: Fri, 6 Mar 2009 07:43:09 -0800	[thread overview]
Message-ID: <20090306154309.GF16213@spearce.org> (raw)
In-Reply-To: <1236353138-1427-1-git-send-email-j16sdiz+freenet@sdiz.net>

"Daniel Cheng (aka SDiZ)" <j16sdiz+freenet@gmail.com> wrote:
> When doing a WalkTransport with packed-ref, peeled
> line are not handled correctly. This patch fix the
> issue.

Wow.  That old code was really wrong.  :-)

Signed-off-by?  (See SUBMITTING_PATCHES, "(5) Sign your work")

> 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

If I'm at fault for that preimage, I should just be put out to
pasture now... before I do any more harm... *sigh*

-- 
Shawn.

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06 15:25 [PATCH] [JGit] Fix parsing peeled line in packed-ref Daniel Cheng (aka SDiZ)
2009-03-06 15:43 ` Shawn O. Pearce [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-03-06 15:26 Daniel Cheng (aka SDiZ)
2009-03-06 16:05 [PATCH JGIT] " Daniel Cheng (aka SDiZ)
2009-03-06 16:19 ` 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=20090306154309.GF16213@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=j16sdiz+freenet@gmail.com \
    --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).