Browse Source

pgm: add option if reflogs should be written when converting to reftable

Change-Id: Ie1c38121005965e63015d9a2af26a1caa88d73fa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.7
Matthias Sohn 5 years ago
parent
commit
c2a3ce7965
  1. 1
      org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
  2. 6
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ConvertRefStorage.java

1
org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties

@ -331,6 +331,7 @@ usage_configureTheServiceInDaemonServicename=configure the service in daemon.ser
usage_convertRefStorage=Convert ref storage to reftable usage_convertRefStorage=Convert ref storage to reftable
usage_convertRefStorageBackup=Create backup of old ref storage format usage_convertRefStorageBackup=Create backup of old ref storage format
usage_convertRefStorageFormat=Format to convert to (reftable or refdir) usage_convertRefStorageFormat=Format to convert to (reftable or refdir)
usage_convertRefStorageRefLogs=Write reflogs to reftable
usage_createBranchAndCheckout=create branch and check out usage_createBranchAndCheckout=create branch and check out
usage_deleteBranchEvenIfNotMerged=delete branch (even if not merged) usage_deleteBranchEvenIfNotMerged=delete branch (even if not merged)
usage_deleteFullyMergedBranch=delete fully merged branch usage_deleteFullyMergedBranch=delete fully merged branch

6
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ConvertRefStorage.java

@ -57,9 +57,13 @@ class ConvertRefStorage extends TextBuiltin {
"-b" }, usage = "usage_convertRefStorageBackup") "-b" }, usage = "usage_convertRefStorageBackup")
private boolean backup = true; private boolean backup = true;
@Option(name = "--reflogs", handler = ExplicitBooleanOptionHandler.class, aliases = {
"-r" }, usage = "usage_convertRefStorageRefLogs")
private boolean writeLogs = true;
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
protected void run() throws Exception { protected void run() throws Exception {
((FileRepository) db).convertRefStorage(format, true, backup); ((FileRepository) db).convertRefStorage(format, writeLogs, backup);
} }
} }

Loading…
Cancel
Save