From 5196798cb743aa9e9a0e7d92c64e9c930656acaa Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Mon, 4 Jul 2016 17:23:47 -0700 Subject: [PATCH] UploadPack: Include peeled ObjectId as advertised A RefAdvertiser writing to the network includes both the reference's ObjectId and its peeled ObjectId in the advertised set. In smart HTTP negotiation requests may bypass the RefAdvertiser and quickly build the set based on current refs; include the peeled ObjectIds to match behavior with the normal bidirectional protocols on git:// and SSH. Change-Id: I5371bed60da36e8d12c4ad9a5c1d91a0f0ad486b --- .../src/org/eclipse/jgit/transport/UploadPack.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 3f68bfeb74..e1770f282b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -777,8 +777,14 @@ public class UploadPack { private static Set refIdSet(Collection refs) { Set ids = new HashSet(refs.size()); for (Ref ref : refs) { - if (ref.getObjectId() != null) - ids.add(ref.getObjectId()); + ObjectId id = ref.getObjectId(); + if (id != null) { + ids.add(id); + } + id = ref.getPeeledObjectId(); + if (id != null) { + ids.add(id); + } } return ids; } -- 2.39.5