Merge "Mark project and user options as required for LsUserRefs" into stable-2.6

This commit is contained in:
David Pursehouse
2013-05-02 01:10:55 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 8 deletions

View File

@@ -31,11 +31,11 @@ OPTIONS
-------
--project::
-p::
Name of the project for which the refs should be listed.
Required; Name of the project for which the refs should be listed.
--user::
-u::
User for which the visible refs should be listed. Gerrit
Required; User for which the visible refs should be listed. Gerrit
will query the database to find matching users, so the
full identity/name does not need to be specified.

View File

@@ -58,11 +58,11 @@ public class LsUserRefs extends SshCommand {
private ChangeCache changeCache;
@Option(name = "--project", aliases = {"-p"}, metaVar = "PROJECT",
usage = "project for which the refs should be listed")
required = true, usage = "project for which the refs should be listed")
private ProjectControl projectControl;
@Option(name = "--user", aliases = {"-u"}, metaVar = "USER",
usage = "user for which the groups should be listed")
required = true, usage = "user for which the groups should be listed")
private String userName;
@Option(name = "--only-refs-heads", usage = "list only refs under refs/heads")
@@ -73,10 +73,6 @@ public class LsUserRefs extends SshCommand {
@Override
protected void run() throws Failure {
if (userName == null || projectControl == null) {
throw new UnloggedFailure(1, "fatal: --user and --project options must be used.");
}
Account userAccount = null;
try {
userAccount = accountResolver.find(userName);