Browse Source

Move constants used for config-files to ConfigConstants

Change-Id: I7d8db4bfa1a851afd599bb8eaa8f8273204d2e1d
stable-4.6
Christian Halstrick 8 years ago committed by Matthias Sohn
parent
commit
f30c05fc74
  1. 13
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
  2. 7
      org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
  3. 8
      org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java

13
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";
}

7
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
*

8
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;

Loading…
Cancel
Save