Skip to content

Commit ac7d53a

Browse files
committed
cleanup, check history is enabled for repository
1 parent 5b1b346 commit ac7d53a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected void doCreateCache(HistoryCache cache, String sinceRevision, File dire
9595

9696
FileCollector fileCollector = null;
9797
Project project = Project.getProject(directory);
98-
if (project != null && isHistoryBasedReindex()) {
98+
if (project != null && isHistoryBasedReindex() && isHistoryEnabled()) {
9999
// The fileCollector has to go through merge changesets no matter what the configuration says
100100
// in order to detect the files that need to be indexed.
101101
fileCollector = new FileCollector(true);

opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexDatabase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ private static List<Repository> getRepositoriesForProject(Project project) {
442442

443443
/**
444444
* @return whether the repositories of given project are ready for history based reindex
445-
* TODO: move part of this to doCreateCache() (project specific and global checks)
446445
*/
447446
private boolean isReadyForHistoryBasedReindex() {
448447
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
@@ -478,7 +477,7 @@ private boolean isReadyForHistoryBasedReindex() {
478477

479478
/*
480479
* Check that the index is present for this project.
481-
* In such case the traversal of all changesets would most likely be counterproductive,
480+
* In case of the initial indexing, the traversal of all changesets would most likely be counterproductive,
482481
* assuming traversal of directory tree is cheaper than getting the files from SCM history
483482
* in such case.
484483
*/

0 commit comments

Comments
 (0)