You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Repo.java 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (C) 2014, Google Inc. and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.pgm;
  11. import org.eclipse.jgit.api.errors.GitAPIException;
  12. import org.eclipse.jgit.gitrepo.RepoCommand;
  13. import org.kohsuke.args4j.Argument;
  14. import org.kohsuke.args4j.Option;
  15. @Command(common = true, usage = "usage_parseRepoManifest")
  16. class Repo extends TextBuiltin {
  17. @Option(name = "--base-uri", aliases = { "-u" }, usage = "usage_baseUri")
  18. private String uri;
  19. @Option(name = "--groups", aliases = { "-g" }, usage = "usage_groups")
  20. private String groups = "default"; //$NON-NLS-1$
  21. @Argument(required = true, metaVar = "metaVar_path", usage = "usage_pathToXml")
  22. private String path;
  23. /** {@inheritDoc} */
  24. @Override
  25. protected void run() {
  26. try {
  27. new RepoCommand(db)
  28. .setURI(uri)
  29. .setPath(path)
  30. .setGroups(groups)
  31. .call();
  32. } catch (GitAPIException e) {
  33. throw die(e.getMessage(), e);
  34. }
  35. }
  36. }