From 23c3702686c2c9e1e711b9a8d9da09852372c63c Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Wed, 13 Mar 2019 21:39:51 -0700 Subject: [PATCH] BaseReceive/UploadPack: Stop using deprecated RefAdvertiser.send(Map) RefAdvertiser.send(Map) is deprecated in favour of RefAdvertiser.send(Collection). Subclasses that need to override the "send" method need to override also the deprecated version, because it is still invoked by BaseReceivePack and UploadPack. Remove the last usages of the deprecated method. Change-Id: I7eba426970251f78801ddf96b87a65d1baaebdcf Signed-off-by: Ivan Frade --- .../src/org/eclipse/jgit/transport/BaseReceivePack.java | 2 +- .../src/org/eclipse/jgit/transport/UploadPack.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java index 2946e9835..1741db97f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java @@ -1241,7 +1241,7 @@ public abstract class BaseReceivePack { adv.advertiseCapability(CAPABILITY_PUSH_OPTIONS); } adv.advertiseCapability(OPTION_AGENT, UserAgent.get()); - adv.send(getAdvertisedOrDefaultRefs()); + adv.send(getAdvertisedOrDefaultRefs().values()); for (ObjectId obj : advertisedHaves) adv.advertiseHave(obj); if (adv.isEmpty()) 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 52c3cdedc..fe3e8141f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -1066,7 +1066,7 @@ public class UploadPack { findSymrefs(adv, refsToSend); } - adv.send(refsToSend); + adv.send(refsToSend.values()); adv.end(); } @@ -1477,7 +1477,8 @@ public class UploadPack { } adv.setDerefTags(true); findSymrefs(adv, advertisedOrDefaultRefs); - advertised = adv.send(advertisedOrDefaultRefs); + advertised = adv.send(advertisedOrDefaultRefs.values()); + if (adv.isEmpty()) adv.advertiseId(ObjectId.zeroId(), "capabilities^{}"); //$NON-NLS-1$ adv.end();