Always show repo download command if repo download scheme is enabled
At the moment the repo download command is only shown in the repo
download scheme if it is explicitly enabled in the gerrit.config by
setting download.command = repo_download. Since the repo download
command is the only command that makes sense for the repo download
scheme it should always be displayed when the repo download scheme is
enabled. It doesn't make sense to be able to enable the repo download
scheme and to disable the repo download command at the same time.
Change-Id: I79758f81c43b43c52dc6ecd116b7cda66f02374b
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/download/command/RepoCommand.java b/src/main/java/com/googlesource/gerrit/plugins/download/command/RepoCommand.java
index 2edfac3..7f11bed 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/download/command/RepoCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/download/command/RepoCommand.java
@@ -14,8 +14,6 @@
package com.googlesource.gerrit.plugins.download.command;
-import static com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadCommand.REPO_DOWNLOAD;
-
import com.google.gerrit.extensions.config.DownloadCommand;
import com.google.gerrit.extensions.config.DownloadScheme;
import com.google.gerrit.server.config.DownloadConfig;
@@ -24,16 +22,14 @@
import com.googlesource.gerrit.plugins.download.scheme.RepoScheme;
public class RepoCommand extends DownloadCommand {
- private final boolean commandAllowed;
@Inject
RepoCommand(DownloadConfig downloadConfig) {
- this.commandAllowed = downloadConfig.getDownloadCommands().contains(REPO_DOWNLOAD);
}
@Override
public String getCommand(DownloadScheme scheme, String project, String ref) {
- if (commandAllowed && scheme instanceof RepoScheme) {
+ if (scheme instanceof RepoScheme) {
String id = trim(ref);
if (id != null) {
return "repo download " + scheme.getUrl(project) + " " + id;