Fix validation of code-owner.config files

The validation may be invoked for a commit which is not present in the
repository yet and trying to load it via a new RevWalk fails with
MissingObjectException. Such commits are only visible through the
RevWalk that is creating the commit. This RevWalk is passed in together
with the CommitReceivedEvent. We must use this RevWalk instance to load
the commit from the event.

For example the validation of code-owner.config files failed with
MissingObjectException when a change for refs/meta/config was rebased.
It failed regardless of whether the change actually touched a
code-owners.config file (because we need to load the commit to know if
the code-owners.config file was touched).

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I5fc34f0302fbf77908fba56da5d94924a0d05bd8
2 files changed
tree: 1bfd3fa3392fa8943ca69b1cf546e93c1970965d
  1. java/
  2. javatests/
  3. proto/
  4. resources/
  5. test/
  6. ui/
  7. .eslintrc.json
  8. .gitignore
  9. .gitreview
  10. bower.json
  11. BUILD
  12. LICENSE
  13. package-lock.json
  14. package.json
  15. README.md
README.md

Gerrit Code Review code-owners plugin

This plugin provides support for defining code owners for files in a repository.

If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.

Also see resources/Documentation/about.md

IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md