File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
opengrok-indexer/src/main/java/org/opengrok/indexer/index Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -843,19 +843,20 @@ private boolean accept(File file, AcceptSymlinkRet ret) {
843
843
return true ;
844
844
}
845
845
846
- if (HistoryGuru .getInstance ().hasHistory (file )) {
847
- // versioned files should always be accepted
848
- return true ;
849
- }
850
846
851
- // this is an unversioned file, check if it should be indexed
852
847
RuntimeEnvironment env = RuntimeEnvironment .getInstance ();
853
- boolean res = !env .isIndexVersionedFilesOnly ();
854
- if (!res ) {
855
- LOGGER .log (Level .FINER , "not accepting unversioned {0}" ,
856
- absolutePath );
848
+ // Lookup history if indexing versioned files only.
849
+ // Skip the lookup entirely (which is expensive) if unversioned files are allowed
850
+ if (env .isIndexVersionedFilesOnly ()) {
851
+ if (HistoryGuru .getInstance ().hasHistory (file )) {
852
+ // versioned files should always be accepted
853
+ return true ;
854
+ }
855
+ LOGGER .log (Level .FINER , "not accepting unversioned {0}" , absolutePath );
856
+ return false ;
857
857
}
858
- return res ;
858
+ // unversioned files are allowed
859
+ return true ;
859
860
}
860
861
861
862
/**
You can’t perform that action at this time.
0 commit comments