Skip to content

Commit b289da3

Browse files
author
Vladimir Kotal
committed
JGit is always working
1 parent 865a992 commit b289da3

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/GitRepository.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
import org.opengrok.indexer.configuration.RuntimeEnvironment;
8484
import org.opengrok.indexer.logger.LoggerFactory;
8585
import org.opengrok.indexer.util.ForbiddenSymlinkException;
86-
import org.opengrok.indexer.util.LazilyInstantiate;
8786

8887
import static org.opengrok.indexer.history.HistoryEntry.TAGS_SEPARATOR;
8988

@@ -97,12 +96,6 @@ public class GitRepository extends RepositoryWithPerPartesHistory {
9796

9897
private static final long serialVersionUID = -6126297612958508386L;
9998

100-
/**
101-
* This is a static replacement for 'working' field. Effectively, check if git is working once in a JVM
102-
* instead of calling it for every GitRepository instance.
103-
*/
104-
private static final LazilyInstantiate<Boolean> GIT_IS_WORKING = LazilyInstantiate.using(GitRepository::isGitWorking);
105-
10699
public static final int GIT_ABBREV_LEN = 8;
107100
public static final int MAX_CHANGESETS = 512;
108101

@@ -113,10 +106,6 @@ public GitRepository() {
113106
ignoredFiles.add(".git");
114107
}
115108

116-
private static boolean isGitWorking() {
117-
return true;
118-
}
119-
120109
/**
121110
* Be careful, git uses only forward slashes in its command and output (not in file path).
122111
* Using backslashes together with git show will get empty output and 0 status code.
@@ -452,11 +441,7 @@ boolean isNestable() {
452441

453442
@Override
454443
public boolean isWorking() {
455-
if (working == null) {
456-
working = GIT_IS_WORKING.get();
457-
}
458-
459-
return working;
444+
return true;
460445
}
461446

462447
@Override

0 commit comments

Comments
 (0)