Browse Source

BaseReceive/UploadPack: Stop using deprecated RefAdvertiser.send(Map)

RefAdvertiser.send(Map<String, Ref>) is deprecated in favour of
RefAdvertiser.send(Collection<Ref>). 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 <ifrade@google.com>
stable-5.4
Ivan Frade 6 years ago
parent
commit
23c3702686
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
  2. 5
      org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

2
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())

5
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();

Loading…
Cancel
Save