Fix NPE when accessing optional gitRepositoryManager

Change I95ca0c2f9 introduced the concept of GitRepositoryManager
annotated by LocalDiskRepositoryManager, optionally injected via Guice
only when a named binding was provided.

This was merged fine into stable-3.4, however it was mismerged when
brought up to stable-3.5, since additional calls (`canPerformGC()` and
`getRepositoryStatus()`) were not adapted and kept calling the optional
`gitRepositoryManager` directly, causing a NPE:

Caused by: NullPointerException at
SharedRefDbGitRepositoryManager.canPerformGC(SharedRefDbGitRepositoryManager.java:119)

Always access the repository manager via the `repositoryManager()`
getter instead.

Bug: Issue 16527
Change-Id: I34b780043acc22db9160db1e1dbf0c194f39c4d7
2 files changed
tree: 4bb64c22197a63d21156980e95e3298eec274125
  1. src/
  2. .gitignore
  3. bindings.md
  4. BUILD
  5. config.md
  6. Jenkinsfile
  7. LICENSE
  8. pom.xml
  9. README.md
README.md

Gerrit interface to a global-refdb

Global ref-database interface for use with Gerrit Code Review.

Enables the de-coupling between Gerrit, its libModules and the different implementations of a globally shared ref-database.

Design

The design for a global ref-db interface can be found as part of the multi-site design documentation, where it first originated and was approved by the community.

Bindings

In order to consume this library, some Guice bindings need to be registered appropriately. More information in the relevant documentation.