1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.pgm;
12
13 import org.eclipse.jgit.internal.storage.file.FileRepository;
14 import org.kohsuke.args4j.Option;
15 import org.kohsuke.args4j.spi.ExplicitBooleanOptionHandler;
16
17 @Command(common = true, usage = "usage_convertRefStorage")
18 class ConvertRefStorage extends TextBuiltin {
19
20 @Option(name = "--format", usage = "usage_convertRefStorageFormat")
21 private String format = "reftable";
22
23 @Option(name = "--backup", handler = ExplicitBooleanOptionHandler.class, aliases = {
24 "-b" }, usage = "usage_convertRefStorageBackup")
25 private boolean backup = true;
26
27 @Option(name = "--reflogs", handler = ExplicitBooleanOptionHandler.class, aliases = {
28 "-r" }, usage = "usage_convertRefStorageRefLogs")
29 private boolean writeLogs = true;
30
31
32 @Override
33 protected void run() throws Exception {
34 ((FileRepository) db).convertRefStorage(format, writeLogs, backup);
35 }
36 }