commit | 3bfcbf468184793d605ca8fab9cce8e6de6c687f | [log] [tgz] |
---|---|---|
author | Shawn Pearce <sop@google.com> | Thu Oct 17 09:40:19 2013 -0700 |
committer | Shawn Pearce <sop@google.com> | Thu Oct 17 10:01:30 2013 -0700 |
tree | b9aae8c566c71e548f655e86034fba4a441198b0 | |
parent | 7e0fa44b8e5598b37e0cb96d8c0f5d88fca7a049 [diff] |
Simplify logic in RepoCommand Instead of negative testing before return null, check for when the command should be enabled and format the string only in this case. Change-Id: I9fcbf902d62cc76965707a005f0572a8bf75e28f
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 26a40ec..5fa8118 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
@@ -33,10 +33,9 @@ @Override public String getCommand(DownloadScheme scheme, String project, String ref) { - if (!commandAllowed || !(scheme instanceof RepoScheme)) { - return null; + if (commandAllowed && scheme instanceof RepoScheme) { + return scheme.getUrl(project) + " " + ref; } - - return scheme.getUrl(project) + " " + ref; + return null; } }