#
# default meta variable defined in the org.kohsuke.args4j.spi.StringOptionHandler
VAL=VAL
+# default meta variable defined in the org.kohsuke.args4j.spi.ExplicitBooleanOptionHandler
+VALUE=VAL
# default meta variable defined in the org.kohsuke.args4j.spi.StopOptionHandler
ARGUMENTS=ARGUMENTS
# default meta variable defined in the org.kohsuke.args4j.spi.OneArgumentOptionHandler
usage_configSystem=use system-wide configuration in $(prefix)/etc/gitconfig
usage_configureTheServiceInDaemonServicename=configure the service in daemon.servicename
usage_convertRefStorage=Convert ref storage to reftable
+usage_convertRefStorageBackup=Create backup of old ref storage format
usage_convertRefStorageFormat=Format to convert to (reftable or refdir)
usage_createBranchAndCheckout=create branch and check out
usage_deleteBranchEvenIfNotMerged=delete branch (even if not merged)
import org.eclipse.jgit.internal.storage.file.FileRepository;
import org.kohsuke.args4j.Option;
+import org.kohsuke.args4j.spi.ExplicitBooleanOptionHandler;
@Command(common = true, usage = "usage_convertRefStorage")
class ConvertRefStorage extends TextBuiltin {
@Option(name = "--format", usage = "usage_convertRefStorageFormat")
private String format = "reftable"; //$NON-NLS-1$
+ @Option(name = "--backup", handler = ExplicitBooleanOptionHandler.class, aliases = {
+ "-b" }, usage = "usage_convertRefStorageBackup")
+ private boolean backup = true;
+
/** {@inheritDoc} */
@Override
protected void run() throws Exception {
- ((FileRepository) db).convertRefStorage(format, true, true);
+ ((FileRepository) db).convertRefStorage(format, true, backup);
}
}