From 3880a47e1b0cdfb391b9a91f88442760b9a3afe3 Mon Sep 17 00:00:00 2001 From: "Daniel Cheng (aka SDiZ)" Date: Sat, 7 Mar 2009 00:05:50 +0800 Subject: [PATCH] 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 --- .../src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a4f89611..d8e727bb 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 @@ abstract class WalkRemoteObjectDatabase { 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); -- 2.11.4.GIT