summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2019-03-13 21:39:51 -0700
committerIvan Frade <ifrade@google.com>2019-03-14 11:27:27 -0700
commit23c3702686c2c9e1e711b9a8d9da09852372c63c (patch)
tree3cc86c2427a1de4add34f3b75d2219caad061435
parente53b98ba2f561768eb82d23d78b2227e0df2b6eb (diff)
downloadjgit-23c3702686c2c9e1e711b9a8d9da09852372c63c.tar.gz
jgit-23c3702686c2c9e1e711b9a8d9da09852372c63c.zip
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>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java5
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 2946e98357..1741db97fe 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 52c3cdedca..fe3e8141f4 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();