From f30c05fc74424b72a8637be67d74ce14ea56d769 Mon Sep 17 00:00:00 2001 From: Christian Halstrick Date: Thu, 20 Oct 2016 16:13:24 +0200 Subject: [PATCH] Move constants used for config-files to ConfigConstants Change-Id: I7d8db4bfa1a851afd599bb8eaa8f8273204d2e1d --- .../src/org/eclipse/jgit/lib/ConfigConstants.java | 13 +++++++++++++ .../src/org/eclipse/jgit/lib/Constants.java | 7 ------- .../src/org/eclipse/jgit/treewalk/TreeWalk.java | 8 +++++--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java index 4d3e11801..cde41c212 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java @@ -107,6 +107,12 @@ public class ConfigConstants { */ public static final String CONFIG_PULL_SECTION = "pull"; + /** + * The "filter" section + * @since 4.6 + */ + public static final String CONFIG_FILTER_SECTION = "filter"; + /** The "algorithm" key */ public static final String CONFIG_KEY_ALGORITHM = "algorithm"; @@ -361,4 +367,11 @@ public class ConfigConstants { * @since 4.0 */ public static final String CONFIG_KEY_STREAM_RATIO = "streamRatio"; + + /** + * Flag in the filter section whether to use JGit's implementations of + * filters and hooks + * @since 4.6 + */ + public static final String CONFIG_KEY_USEJGITBUILTIN = "useJGitBuiltin"; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java index f9350a574..ff80672f8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java @@ -391,13 +391,6 @@ public final class Constants { */ public static final String ATTR_FILTER_TYPE_SMUDGE = "smudge"; - /** - * Whether to use JGit's implementations of filters and hooks - * - * @since 4.6 - */ - public static final String ATTR_FILTER_USE_BUILTIN = "useJGitBuiltin"; - /** * Builtin filter commands start with this prefix * diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java index 21cd6b83a..fdaeb1d61 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java @@ -65,6 +65,7 @@ import org.eclipse.jgit.errors.MissingObjectException; import org.eclipse.jgit.errors.StopWalkException; import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.Config; +import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.CoreConfig.EolStreamType; import org.eclipse.jgit.lib.FileMode; @@ -1372,10 +1373,11 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { String filterCommand = filterCommandsByNameDotType.get(key); if (filterCommand != null) return filterCommand; - filterCommand = config.getString(Constants.ATTR_FILTER, + filterCommand = config.getString(ConfigConstants.CONFIG_FILTER_SECTION, filterDriverName, filterCommandType); - boolean useBuiltin = config.getBoolean(Constants.ATTR_FILTER, - filterDriverName, Constants.ATTR_FILTER_USE_BUILTIN, false); + boolean useBuiltin = config.getBoolean( + ConfigConstants.CONFIG_FILTER_SECTION, + filterDriverName, ConfigConstants.CONFIG_KEY_USEJGITBUILTIN, false); if (useBuiltin) { String builtinFilterCommand = Constants.BUILTIN_FILTER_PREFIX + filterDriverName + '/' + filterCommandType;