Browse Source
AdvertiseRefsHook is used to limit the visibility of the refs in Gerrit. If this hook is not called, then all refs are treated as visible. In protocol v2, the hook is not called, causing the server to advertise all refs. This bug was introduced in v5.0.0.201805221745-rc1~1^2~9 (Execute AdvertiseRefsHook only for protocol v0 and v1, 2018-05-14). Even before then, the hook was not called in requests after the capability advertisement, so in transports like HTTP that do not retain state between round-trips, the server would advertise all refs in response to an ls-refs (ls-remote) request. Fix both cases by using getAdvertisedOrDefaultRefs to retrieve the advertised refs in lsRefs, ensuring the hook is called in all cases that use its result. [jn: backported to stable-5.0; split out from a larger patch that also fixes protocol v0; avoided filtering this.refs by ref prefix] Change-Id: I64bce0e72d15b90baccc235c067e57b6af21b55f Signed-off-by: Masaya Suzuki <masayasuzuki@google.com> Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>stable-5.0
Masaya Suzuki
6 years ago
committed by
Matthias Sohn
1 changed files with 46 additions and 14 deletions
Loading…
Reference in new issue