From 26cc4ed9fad9796756d34ae0fd3350bd3c139c7a Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 17 Apr 2014 20:32:05 -0400 Subject: [PATCH] [findbugs] Fix incorrect key lookup in commit cache --- src/main/java/com/gitblit/utils/CommitCache.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gitblit/utils/CommitCache.java b/src/main/java/com/gitblit/utils/CommitCache.java index fd3a6597..a3963f50 100644 --- a/src/main/java/com/gitblit/utils/CommitCache.java +++ b/src/main/java/com/gitblit/utils/CommitCache.java @@ -225,7 +225,8 @@ public class CommitCache { List commits = new ArrayList(); for (RevCommit commit : JGitUtils.getRevLog(repository, branch, sinceDate)) { RepositoryCommit commitModel = new RepositoryCommit(repositoryName, branch, commit); - commitModel.setRefs(allRefs.get(commitModel.getName())); + List commitRefs = allRefs.get(commitModel.getId()); + commitModel.setRefs(commitRefs); commits.add(commitModel); } return commits; @@ -245,7 +246,8 @@ public class CommitCache { List commits = new ArrayList(); for (RevCommit commit : JGitUtils.getRevLog(repository, sinceCommit.getName(), branch)) { RepositoryCommit commitModel = new RepositoryCommit(repositoryName, branch, commit); - commitModel.setRefs(allRefs.get(commitModel.getName())); + List commitRefs = allRefs.get(commitModel.getId()); + commitModel.setRefs(commitRefs); commits.add(commitModel); } return commits; -- 2.39.5