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.

ConvertRefStorage.java 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (C) 2019, Google LLC 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.internal.storage.file.FileRepository;
  12. import org.kohsuke.args4j.Option;
  13. import org.kohsuke.args4j.spi.ExplicitBooleanOptionHandler;
  14. @Command(common = true, usage = "usage_convertRefStorage")
  15. class ConvertRefStorage extends TextBuiltin {
  16. @Option(name = "--format", usage = "usage_convertRefStorageFormat")
  17. private String format = "reftable"; //$NON-NLS-1$
  18. @Option(name = "--backup", handler = ExplicitBooleanOptionHandler.class, aliases = {
  19. "-b" }, usage = "usage_convertRefStorageBackup")
  20. private boolean backup = true;
  21. @Option(name = "--reflogs", handler = ExplicitBooleanOptionHandler.class, aliases = {
  22. "-r" }, usage = "usage_convertRefStorageRefLogs")
  23. private boolean writeLogs = true;
  24. /** {@inheritDoc} */
  25. @Override
  26. protected void run() throws Exception {
  27. ((FileRepository) db).convertRefStorage(format, writeLogs, backup);
  28. }
  29. }