Files
gerrit/gerrit-acceptance-tests
Dave Borowitz 563634e70a OnSubmitValidationListener: Don't expose Repository
If we give extensions a full Repository, it's possible to use it in an
incorrect way. For example, a RevWalk created with `new RevWalk(repo)`
will not be able to read the ObjectIds returned by `getCommands()`.
Instead, expose only a RevWalk and a getRef method that calls into the
ChainedReceiveCommands. This is more limiting, because it can't do
everything a Repository can do, but it is impossible to use in this
incorrect way.

The only known existing OnSubmitValidationListener is in the
git-numberer plugin[1], which will be able to do what it needs with this
restricted interface.

[1] https://chromium-review.googlesource.com/q/project:infra%252Fgerrit-plugins%252Fgit-numberer

Change-Id: I4a20ea34e49e30714e269b46835b55c43d7a121e
2017-04-10 10:04:23 -04:00
..