Skip to content

Commit 701fae2

Browse files
author
Vladimir Kotal
committed
be content with just history cache directory in ensureHistoryCacheExists()
fixes #3260
1 parent a00dc57 commit 701fae2

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,7 @@ private List<Repository> getReposFromString(Collection<String> repositories) {
730730

731731
/**
732732
* Ensure that we have a directory in the cache. If it's not there, fetch
733-
* its history and populate the cache. If it's already there, and the cache
734-
* is able to tell how recent it is, attempt to update it to the most recent
735-
* revision.
733+
* its history and populate the cache.
736734
*
737735
* @param file the root path to test
738736
* @throws HistoryException if an error occurs while accessing the history
@@ -745,24 +743,15 @@ public void ensureHistoryCacheExists(File file) throws HistoryException {
745743

746744
Repository repository = getRepository(file);
747745
if (repository == null) {
748-
// no repository -> no history :(
746+
// no repository -> no history
749747
return;
750748
}
751749

752-
String sinceRevision = null;
753-
754750
if (historyCache.hasCacheForDirectory(file, repository)) {
755-
sinceRevision = historyCache.getLatestCachedRevision(repository);
756-
if (sinceRevision == null) {
757-
// Cache already exists, but we don't know how recent it is,
758-
// so don't do anything.
759-
return;
760-
}
751+
return;
761752
}
762753

763-
// Create cache from the beginning if it doesn't exist, or update it
764-
// incrementally otherwise.
765-
createCache(repository, sinceRevision);
754+
createCache(repository, null);
766755
}
767756

768757
protected Repository getRepository(File path) {

0 commit comments

Comments
 (0)