Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fix parsing peeled line in packed-ref

When doing a WalkTransport with packed-ref, peeled
lines are not handled correctly, due to an incorrect
attempt to remove the leading "^" prefix.  Strip the
leading "^" before parsing the ObjectId.

Signed-off-by: Daniel Cheng (aka SDiZ) <>
Signed-off-by: Shawn O. Pearce <>
  • Loading branch information...
commit 3880a47e1b0cdfb391b9a91f88442760b9a3afe3 1 parent 0aae0d8
@j16sdiz j16sdiz authored spearce committed
2  org.spearce.jgit/src/org/spearce/jgit/transport/
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.