Permalink
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) <j16sdiz+freenet@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information...
j16sdiz authored and spearce committed Mar 6, 2009
1 parent 0aae0d8 commit 3880a47e1b0cdfb391b9a91f88442760b9a3afe3
@@ -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);

0 comments on commit 3880a47

Please sign in to comment.