diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTree.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTree.java index 66c0be676..43eec5185 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTree.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTree.java @@ -100,15 +100,15 @@ import org.eclipse.jgit.util.RawParseUtils; * blob storing the name of the target reference. *

* Annotated tags also store the peeled object using a {@code GITLINK} entry - * with the suffix "^{}", for example {@code "tags/v1.0"} stores - * the annotated tag object, while "tags/v1.0^{}" stores the commit - * the tag annotates. + * with the suffix " ^" (space carrot), for example + * {@code "tags/v1.0"} stores the annotated tag object, while + * "tags/v1.0 ^" stores the commit the tag annotates. *

* {@code HEAD} is a special case and stored as {@code "..HEAD"}. */ public class RefTree { /** Suffix applied to GITLINK to indicate its the peeled value of a tag. */ - public static final String PEELED_SUFFIX = "^{}"; //$NON-NLS-1$ + public static final String PEELED_SUFFIX = " ^"; //$NON-NLS-1$ static final String ROOT_DOTDOT = ".."; //$NON-NLS-1$ /** diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java index b3aeed0df..d383abf31 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java @@ -230,7 +230,7 @@ class Scanner { private static boolean curElementHasPeelSuffix(AbstractTreeIterator itr) { int n = itr.getEntryPathLength(); byte[] c = itr.getEntryPathBuffer(); - return n > 3 && c[n - 3] == '^' && c[n - 2] == '{' && c[n - 1] == '}'; + return n > 2 && c[n - 2] == ' ' && c[n - 1] == '^'; } private static void peel(RefList.Builder all, CanonicalTreeParser p) { @@ -272,7 +272,7 @@ class Scanner { byte[] buf = p.getEntryPathBuffer(); int len = p.getEntryPathLength(); if (peel) { - len -= 3; + len -= 2; } int ptr = 0; if (RawParseUtils.match(buf, ptr, REFS_DOT_DOT) > 0) {