Skip to content

Commit 6fb2132

Browse files
authored
Merge pull request #1645 from vladak/OpenGroklatestRev_create
do not create OpenGroklatestRev file if history directory for given r…
2 parents 7270e19 + 6486af2 commit 6fb2132

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/org/opensolaris/opengrok/history/FileHistoryCache.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,14 @@ private void storeFile(History histNew, File file, Repository repo)
351351
}
352352

353353
private void finishStore(Repository repository, String latestRev) {
354-
storeLatestCachedRevision(repository, latestRev);
354+
File file = new File(getRepositoryHistDataDirname(repository));
355+
// If the history was not created for some reason (e.g. temporary
356+
// failure), do not create the CachedRevision file as this would
357+
// create confusion (once it starts working again).
358+
if (file.isDirectory()) {
359+
storeLatestCachedRevision(repository, latestRev);
360+
}
361+
355362
LOGGER.log(Level.FINE,
356363
"Done storing history for repo {0}",
357364
new Object[] {repository.getDirectoryName()});

0 commit comments

Comments
 (0)