commit | 28980fe4f22a354bb0c809a13b23371789b63b6e | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Fri Dec 02 23:42:06 2022 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Fri Dec 02 23:42:06 2022 +0000 |
tree | c45f7db2ab4818396a0dc44eeafedd7222d4a44f | |
parent | 2fe69c0b724f9ae91261666838700d516d792d2b [diff] | |
parent | 4fef4daf5f5bcf01e54f9d49b0bd62539f10dc80 [diff] |
Merge "Allow binding the module without GitRepositoryManager" into stable-3.3
diff --git a/src/main/java/com/googlesource/gerrit/plugins/cachedrefdb/CachedRefDatabase.java b/src/main/java/com/googlesource/gerrit/plugins/cachedrefdb/CachedRefDatabase.java index 04541bd..e40e41b 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/cachedrefdb/CachedRefDatabase.java +++ b/src/main/java/com/googlesource/gerrit/plugins/cachedrefdb/CachedRefDatabase.java
@@ -140,7 +140,12 @@ @Override public List<Ref> getRefs() throws IOException { - return delegate.getRefs(); + List<Ref> allRefs = delegate.getRefs(); + for (Ref ref : allRefs) { + refsCache.computeIfAbsent( + repo.getProjectName(), ref.getName(), () -> Optional.ofNullable(ref)); + } + return allRefs; } @Override