89
89
import org .opengrok .indexer .util .Executor ;
90
90
import org .opengrok .indexer .util .ForbiddenSymlinkException ;
91
91
import org .opengrok .indexer .util .LazilyInstantiate ;
92
- import org .opengrok .indexer .util .Version ;
93
92
94
93
import static org .opengrok .indexer .history .HistoryEntry .TAGS_SEPARATOR ;
95
94
@@ -117,19 +116,6 @@ public class GitRepository extends RepositoryWithPerPartesHistory {
117
116
private static final int CSET_LEN = 8 ;
118
117
private static final String ABBREV_LOG = "--abbrev=" + CSET_LEN ;
119
118
120
- /**
121
- * All git commands that emit date that needs to be parsed by
122
- * {@code getDateFormat()} should use this option.
123
- */
124
- private static final String GIT_DATE_OPT = "--date=iso8601-strict" ;
125
-
126
- /**
127
- * Minimum git version which supports the date format.
128
- *
129
- * @see #GIT_DATE_OPT
130
- */
131
- private static final Version MINIMUM_VERSION = new Version (2 , 1 , 2 );
132
-
133
119
/**
134
120
* This is a static replacement for 'working' field. Effectively, check if git is working once in a JVM
135
121
* instead of calling it for every GitRepository instance.
@@ -156,16 +142,7 @@ public GitRepository() {
156
142
private static boolean isGitWorking () {
157
143
String repoCommand = getCommand (GitRepository .class , CMD_PROPERTY_KEY , CMD_FALLBACK );
158
144
Executor exec = new Executor (new String [] {repoCommand , "--version" });
159
- if (exec .exec (false ) == 0 ) {
160
- final String outputVersion = exec .getOutputString ();
161
- final String version = outputVersion .replaceAll (".*? version (\\ d+(\\ .\\ d+)*).*" , "$1" );
162
- try {
163
- return Version .from (version ).compareTo (MINIMUM_VERSION ) >= 0 ;
164
- } catch (NumberFormatException ex ) {
165
- LOGGER .log (Level .WARNING , String .format ("Unable to detect git version from %s" , outputVersion ), ex );
166
- }
167
- }
168
- return false ;
145
+ return (exec .exec (false ) == 0 );
169
146
}
170
147
171
148
/**
0 commit comments