From 6d27869659e1a3436438ddbb18114f7c8dab6aed Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Tue, 29 Aug 2017 10:25:05 +0200 Subject: [PATCH] Use Config.getEnum() to read the IgnoreSubmoduleMode Doing so goes through the TypedConfigGetter and thus allows library clients (for instance EGit) to warn about invalid configurations. Change-Id: If1080ad90b8aff54a903d4d75637614faad6469b Signed-off-by: Thomas Wolf --- .../src/org/eclipse/jgit/submodule/SubmoduleWalk.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java index 7244c85c7..56784f7a7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java @@ -45,7 +45,6 @@ package org.eclipse.jgit.submodule; import java.io.File; import java.io.IOException; import java.text.MessageFormat; -import java.util.Locale; import java.util.HashMap; import java.util.Map; @@ -691,13 +690,9 @@ public class SubmoduleWalk implements AutoCloseable { public IgnoreSubmoduleMode getModulesIgnore() throws IOException, ConfigInvalidException { lazyLoadModulesConfig(); - String name = modulesConfig.getString( + return modulesConfig.getEnum(IgnoreSubmoduleMode.values(), ConfigConstants.CONFIG_SUBMODULE_SECTION, getModuleName(path), - ConfigConstants.CONFIG_KEY_IGNORE); - if (name == null) - return null; - return IgnoreSubmoduleMode - .valueOf(name.trim().toUpperCase(Locale.ROOT)); + ConfigConstants.CONFIG_KEY_IGNORE, IgnoreSubmoduleMode.NONE); } /**