From: Christian Halstrick Date: Thu, 20 Oct 2016 14:13:24 +0000 (+0200) Subject: Move constants used for config-files to ConfigConstants X-Git-Tag: v4.6.0.201612231935-r~67 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F86%2F83686%2F3;p=jgit.git Move constants used for config-files to ConfigConstants Change-Id: I7d8db4bfa1a851afd599bb8eaa8f8273204d2e1d --- 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 4d3e118011..cde41c2124 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 f9350a5742..ff80672f80 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 21cd6b83a0..fdaeb1d61a 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;