diff options
author | Masaya Suzuki <masayasuzuki@google.com> | 2018-12-18 09:20:54 -0800 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-12-25 23:36:11 +0100 |
commit | 8eecb4f8b746bc01f09df02870e89d4bc4e118b9 (patch) | |
tree | 61d9a1c133d27d7342ce5b375ffb75202147035f /org.eclipse.jgit.http.test/tst/org/eclipse | |
parent | 9caa94239aa15f38402344176fa32c09a2bd121c (diff) | |
download | jgit-8eecb4f8b746bc01f09df02870e89d4bc4e118b9.tar.gz jgit-8eecb4f8b746bc01f09df02870e89d4bc4e118b9.zip |
Call AdvertiseRefsHook for protocol v2
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>
Diffstat (limited to 'org.eclipse.jgit.http.test/tst/org/eclipse')
0 files changed, 0 insertions, 0 deletions