Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache key issue #185

wants to merge 1 commit into from
Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now

@@ -683,7 +683,7 @@ public RepositoryModel getRepositoryModel(String repositoryName) {
repositoryName = repositoryName.replace("%7E", "~").replace("%7e", "~");

if (!repositoryListCache.containsKey(repositoryName)) {

This comment has been minimized.

Copy link

gitblit May 19, 2014


We have to be careful when manipulating repository look-ups. The cache lookups should be case-insensitive - but the filesystem lookups are case-sensitive on case-sensitive filesystems.

I think the better fix is to ensure that cache lookups use the proper key, but leave the file system loading as-is. Try the following and let me know if that yields the same time-saving result.

String repositoryKey = repositoryName.toLowerCase();
if (!repositoryListCache.containsKey(repositoryKey)) {
    RepositoryModel model = loadRepositoryModel(repositoryName);

// cached model
RepositoryModel model = repositoryListCache.get(repositoryKey);
RepositoryModel model = loadRepositoryModel(repositoryName);
RepositoryModel model = loadRepositoryModel(repositoryName.toLowerCase());
if (model == null) {
return null;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.