]> source.dussan.org Git - jgit.git/commitdiff
Move constants used for config-files to ConfigConstants 86/83686/3
authorChristian Halstrick <christian.halstrick@sap.com>
Thu, 20 Oct 2016 14:13:24 +0000 (16:13 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Sat, 22 Oct 2016 23:39:32 +0000 (01:39 +0200)
Change-Id: I7d8db4bfa1a851afd599bb8eaa8f8273204d2e1d

org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java

index 4d3e1180113dbfbd62d0665b4abf12d0ad86234d..cde41c2124386d7b38a9ec0ba1c3afbc3332d5b4 100644 (file)
@@ -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";
 }
index f9350a5742505a5acd4a6ea79623c291f8edb1d2..ff80672f80aaae053f0a21dfff827cb0defc9bd2 100644 (file)
@@ -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
         *
index 21cd6b83a0ff8d7d0b6a9d98b165464f0354cc5b..fdaeb1d61a0229f9614f60649b2a0cfe6df27baa 100644 (file)
@@ -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;