diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-12-14 22:45:09 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-12-15 10:15:46 +0100 |
commit | 83f90a274cc8629caadb7ee3a1838be5e5c12b33 (patch) | |
tree | 7a11f22b727cb3389a4692592a2a2428ea9d9f75 /org.eclipse.jgit.pgm/src/org/eclipse | |
parent | 57f22d6db1e76720fffaafe0db6c1c3964f8b9a1 (diff) | |
download | jgit-83f90a274cc8629caadb7ee3a1838be5e5c12b33.tar.gz jgit-83f90a274cc8629caadb7ee3a1838be5e5c12b33.zip |
Set config "extensions" option when converting ref storage format
When converting to reftable format the option extensions.refStorage must
be set to "reftable" [1]. When converting back to refdir format this
config option needs to be removed.
Introduce constants for refStorage config options, also for the
"reftree" format.
[1] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/master/Documentation/technical/reftable.md#Version-1
Change-Id: I190222fa5edc1ad7309daa9be17ca934ff7971e3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java index 063600f4ea..da58bbcb06 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java @@ -52,6 +52,7 @@ import java.util.List; import org.eclipse.jgit.internal.storage.reftree.RefTree; import org.eclipse.jgit.internal.storage.reftree.RefTreeDatabase; import org.eclipse.jgit.lib.CommitBuilder; +import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectInserter; import org.eclipse.jgit.lib.ObjectReader; @@ -133,8 +134,11 @@ class RebuildRefTree extends TextBuiltin { if (enable && !(db.getRefDatabase() instanceof RefTreeDatabase)) { StoredConfig cfg = db.getConfig(); - cfg.setInt("core", null, "repositoryformatversion", 1); //$NON-NLS-1$ //$NON-NLS-2$ - cfg.setString("extensions", null, "refStorage", "reftree"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + cfg.setInt(ConfigConstants.CONFIG_CORE_SECTION, null, + ConfigConstants.CONFIG_KEY_REPO_FORMAT_VERSION, 1); + cfg.setString(ConfigConstants.CONFIG_EXTENSIONS_SECTION, null, + ConfigConstants.CONFIG_KEY_REFSTORAGE, + ConfigConstants.CONFIG_REFSTORAGE_REFTREE); cfg.save(); errw.println("Enabled reftree."); //$NON-NLS-1$ errw.flush(); |