Files
gerrit/java
Patrick Hiesel 434f490d36 Fix ReceiveCommitsAdvertiseRefsHook, add docs and test coverage
The tests for receive commits ref advertising were further away from
reality than they should have been. In essence, they tested
ReceiveCommitsAdvertiseRefsHook directly, which let room for bugs to
creep in.

Most prominently, we filter metadata for pushes. As metadata we see
refs/changes/* and refs/cache-automerge/* (suboptimal naming is a
concern not addressed by this commit).

When the previous ref filter has already filtered out change refs
then ReceiveCommitsAdvertiseRefsHook became a no-op and did not
advertise the additional .haves it should because of a check for
existence based on the previously advertised refs.

This commit:
 - Fixes the aforementioned bug
 - Brings tests closer to reality by including the whole advertising
   chain, have JGit do the actual advertising and assert on that
 - Document the desired behavior

Change-Id: I230e66eee5b94c6f62b0426e5c16849d993a1cfe
2019-06-18 14:59:32 +02:00
..
2019-05-08 07:33:21 -07:00