Rework ref-update hook to use RefOperationValidationListener

Instead of being invoked on every commit received, the ref-update hook
is now invoked before the ref update operation is finalized. Note that
the hook is no longer invoked on commits pushed for review or on changes
that are merged. It is invoked for creation/deletion of refs, and for
ref updates caused by direct pushes (i.e. bypassing review).

The previous behavior of the ref-update hook is moved into a new hook
named commit-received. A new parameter '--cmdref' is added, and the
special handling of 'refs/for' and 'refs/changes' is removed.

Also-By: David Pursehouse <>
Bug: Issue 5739
Change-Id: I24d8580aef463f8bfb078d90a4e9e2ce6e8b9b93
5 files changed
tree: b52b3e52a6b9f49a80ce5242e9e768e43368f053
  1. src/
  2. .gitignore
  3. BUILD