Suppress warnings about deprecated BaseReceivePack

Upstream JGit has deprecated the BaseReceivePack class in favor of
ReceivePack, but the interface we're using it with (AdvertiseRefsHook)
still references BaseReceivePack which means we can't change any of
our code to use ReceivePack.

Suppress all the warnings.

Change-Id: I4e4615963649056ddcddfbe01bb2e8625f7d2fb7
This commit is contained in:
David Pursehouse
2019-08-20 20:36:17 +09:00
parent ee29c2dcaa
commit 724ac0a207
3 changed files with 4 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ public class HookUtil {
* @return map of refs that were advertised.
* @throws ServiceMayNotContinueException if a problem occurred.
*/
@SuppressWarnings("deprecation")
public static Map<String, Ref> ensureAllRefsAdvertised(BaseReceivePack rp)
throws ServiceMayNotContinueException {
Map<String, Ref> refs = rp.getAdvertisedRefs();

View File

@@ -72,6 +72,7 @@ public class HackPushNegotiateHook implements AdvertiseRefsHook {
throw new UnsupportedOperationException("HackPushNegotiateHook cannot be used for UploadPack");
}
@SuppressWarnings("deprecation")
@Override
public void advertiseRefs(BaseReceivePack rp) throws ServiceMayNotContinueException {
Map<String, Ref> r = rp.getAdvertisedRefs();
@@ -96,6 +97,7 @@ public class HackPushNegotiateHook implements AdvertiseRefsHook {
}
// Scan history until the advertisement is full.
@SuppressWarnings("deprecation")
RevWalk rw = rp.getRevWalk();
rw.reset();
try {

View File

@@ -81,6 +81,7 @@ public class ReceiveCommitsAdvertiseRefsHook implements AdvertiseRefsHook {
"ReceiveCommitsAdvertiseRefsHook cannot be used for UploadPack");
}
@SuppressWarnings("deprecation")
@Override
public void advertiseRefs(BaseReceivePack rp) throws ServiceMayNotContinueException {
Map<String, Ref> advertisedRefs = HookUtil.ensureAllRefsAdvertised(rp);