Thread (22 messages) flat view 22 messages, 3 authors, 2016-06-15

Re: [EGIT PATCH 4/7 v3] Handle peeling of loose refs.

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:45:39
Subsystem: the rest · Maintainer: Linus Torvalds

Robin Rosenberg [off-list ref] wrote:
For packed refs we got peeling automatically from packed-refs,
but for loose tags we have to follow the tags and get the leaf
object in order to comply with the documentation.
I merged your series, but I squashed the following into the patch
I am replying to:
 
 .../src/org/spearce/jgit/lib/Repository.java       |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index 5088150..c953531 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -942,13 +942,17 @@ public String getBranch() throws IOException {
 	}
 
 	/**
-	 * Peel a possibly unpeeled ref and updates it. If the ref cannot be peeled
-	 * the peeled id is set to {@link ObjectId#zeroId()}
+	 * Peel a possibly unpeeled ref and updates it.
+	 * <p>
+	 * If the ref cannot be peeled (as it does not refer to an annotated tag)
+	 * the peeled id stays null, but {@link Ref#isPeeled()} will be true.
 	 * 
 	 * @param ref
 	 *            The ref to peel
-	 * @return The same, an updated ref with peeled info or a new instance with
-	 *         more information
+	 * @return <code>ref</code> if <code>ref.isPeeled()</code> is true; else a
+	 *         new Ref object representing the same data as Ref, but isPeeled()
+	 *         will be true and getPeeledObjectId will contain the peeled object
+	 *         (or null).
 	 */
 	public Ref peel(final Ref ref) {
 		return refs.peel(ref);
-- 
1.6.0.4.969.g58a38

-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help