summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2018-12-25 23:27:13 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2018-12-25 23:27:13 +0100
commit9caa94239aa15f38402344176fa32c09a2bd121c (patch)
tree93350cd442f21dad4e14005c8815087d2e59b704 /org.eclipse.jgit
parent28f0ef8509b93588bc0a42e1cf6b51db06da6474 (diff)
parent23e4765a655198db94ee748c795d6b04853c6369 (diff)
downloadjgit-9caa94239aa15f38402344176fa32c09a2bd121c.tar.gz
jgit-9caa94239aa15f38402344176fa32c09a2bd121c.zip
Merge branch 'stable-4.11' into stable-5.0
* stable-4.11: Prepare 4.11.7-SNAPSHOT builds JGit v4.11.6.201812241910-r Prepare 4.9.9-SNAPSHOT builds JGit v4.9.8.201812241815-r UploadPack: Test filtering by AdvertiseRefsHook in stateless transports Prepare 4.7.8-SNAPSHOT builds JGit v4.7.7.201812240805-r Fix feature versions imported by feature org.eclipse.jgit.pgm Prepare 4.5.6-SNAPSHOT builds JGit v4.5.5.201812240535-r Call AdvertiseRefsHook before validating wants Change-Id: Ie81284ca6d580b0712c49eec610393d0c0c50203 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java19
1 files changed, 8 insertions, 11 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 7de0506bb3..3255a71b3e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
@@ -779,8 +779,14 @@ public class UploadPack {
}
private Map<String, Ref> getAdvertisedOrDefaultRefs() throws IOException {
- if (refs == null)
+ if (refs != null) {
+ return refs;
+ }
+
+ advertiseRefsHook.advertiseRefs(this);
+ if (refs == null) {
setAdvertisedRefs(db.getRefDatabase().getRefs(ALL));
+ }
return refs;
}
@@ -1305,15 +1311,7 @@ public class UploadPack {
return;
}
- try {
- advertiseRefsHook.advertiseRefs(this);
- } catch (ServiceMayNotContinueException fail) {
- if (fail.getMessage() != null) {
- adv.writeOne("ERR " + fail.getMessage()); //$NON-NLS-1$
- fail.setOutput();
- }
- throw fail;
- }
+ Map<String, Ref> advertisedOrDefaultRefs = getAdvertisedOrDefaultRefs();
if (serviceName != null) {
adv.writeOne("# service=" + serviceName + '\n'); //$NON-NLS-1$
@@ -1345,7 +1343,6 @@ public class UploadPack {
adv.advertiseCapability(OPTION_FILTER);
}
adv.setDerefTags(true);
- Map<String, Ref> advertisedOrDefaultRefs = getAdvertisedOrDefaultRefs();
findSymrefs(adv, advertisedOrDefaultRefs);
advertised = adv.send(advertisedOrDefaultRefs);
if (adv.isEmpty())