1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.transport;
12
13 import org.eclipse.jgit.lib.Config;
14 import org.eclipse.jgit.util.StringUtils;
15
16
17
18
19
20
21 public class PushConfig {
22
23
24
25 public enum PushRecurseSubmodulesMode implements Config.ConfigEnum {
26
27
28
29
30 CHECK("check"),
31
32
33
34
35
36 ON_DEMAND("on-demand"),
37
38
39 NO("false");
40
41 private final String configValue;
42
43 private PushRecurseSubmodulesMode(String configValue) {
44 this.configValue = configValue;
45 }
46
47 @Override
48 public String toConfigValue() {
49 return configValue;
50 }
51
52 @Override
53 public boolean matchConfigValue(String s) {
54 if (StringUtils.isEmptyOrNull(s)) {
55 return false;
56 }
57 s = s.replace('-', '_');
58 return name().equalsIgnoreCase(s)
59 || configValue.equalsIgnoreCase(s);
60 }
61 }
62 }