Accept "foo bar" and "foo-bar" for enums
JGit post c98abc9c0586c73ef7df4172644b7dd21c979e9d changed setEnum behavior to store "foo-bar" in a configuration file rather than "foo bar" or "foo_bar" the way Gerrit expects. Replace - with _ to correctly match enum names. Change-Id: I1de25f8c10c5f35f20f96f3b6a679e4ac790666b
This commit is contained in:
@@ -102,7 +102,7 @@ public class ConfigUtil {
|
||||
final String subsection, final String setting, String valueString,
|
||||
final T[] all) {
|
||||
|
||||
String n = valueString.replace(' ', '_');
|
||||
String n = valueString.replace(' ', '_').replace('-', '_');
|
||||
for (final T e : all) {
|
||||
if (equalsIgnoreCase(e.name(), n)) {
|
||||
return e;
|
||||
|
||||
Reference in New Issue
Block a user