}
@Test
- public void testV2CapabilitiesAllowSidebandAll() throws Exception {
- checkAdvertisedIfAllowed("uploadpack", "allowsidebandall", "sideband-all");
+ public void testV2CapabilitiesAdvertiseSidebandAll() throws Exception {
+ server.getConfig().setBoolean("uploadpack", null, "allowsidebandall",
+ true);
+ checkAdvertisedIfAllowed("uploadpack", "advertisesidebandall",
+ "sideband-all");
checkUnadvertisedIfUnallowed("sideband-all");
}
private final boolean allowReachableSha1InWant;
private final boolean allowFilter;
private final boolean allowSidebandAll;
+ private final boolean advertiseSidebandAll;
final @Nullable ProtocolVersion protocolVersion;
final String[] hideRefs;
hideRefs = rc.getStringList("uploadpack", null, "hiderefs");
allowSidebandAll = rc.getBoolean(
"uploadpack", "allowsidebandall", false);
+ advertiseSidebandAll = rc.getBoolean("uploadpack",
+ "advertisesidebandall", false);
}
/**
}
/**
- * @return true if clients are allowed to specify a "sideband-all" line
+ * @return true if the server accepts sideband-all requests (see
+ * {{@link #isAdvertiseSidebandAll()} for the advertisement)
* @since 5.5
*/
public boolean isAllowSidebandAll() {
return allowSidebandAll;
}
+ /**
+ * @return true to advertise sideband all to the clients
+ * @since 5.6
+ */
+ public boolean isAdvertiseSidebandAll() {
+ return advertiseSidebandAll && allowSidebandAll;
+ }
+
/**
* Get {@link org.eclipse.jgit.transport.RefFilter} respecting configured
* hidden refs.
caps.add(COMMAND_FETCH + '='
+ (transferConfig.isAllowFilter() ? OPTION_FILTER + ' ' : "")
+ (advertiseRefInWant ? CAPABILITY_REF_IN_WANT + ' ' : "")
- + (transferConfig.isAllowSidebandAll()
+ + (transferConfig.isAdvertiseSidebandAll()
? OPTION_SIDEBAND_ALL + ' '
: "")
+ (cachedPackUriProvider != null ? "packfile-uris " : "")