Преглед на файлове

UploadPack: add getProtocolV2Hook() method

A caller cannot install a second hook in the UploadPack without
overwriting whatever is already there.

Offer a method to get the current protocol v2 hook, so it can be chained
with new hooks.

Change-Id: Icb06f94ec52b8c8714f509b5b8622d6db42960fb
Signed-off-by: Ivan Frade <ifrade@google.com>
tags/v5.5.0.201908280940-m3
Ivan Frade преди 4 години
родител
ревизия
04cecae3da
променени са 1 файла, в които са добавени 12 реда и са изтрити 0 реда
  1. 12
    0
      org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

+ 12
- 0
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java Целия файл

@@ -601,6 +601,18 @@ public class UploadPack {
this.protocolV2Hook = hook != null ? hook : ProtocolV2Hook.DEFAULT;
}

/**
* Get the currently installed protocol v2 hook.
*
* @return the hook or a default implementation if none installed.
*
* @since 5.5
*/
public ProtocolV2Hook getProtocolV2Hook() {
return this.protocolV2Hook != null ? this.protocolV2Hook
: ProtocolV2Hook.DEFAULT;
}

/**
* Set the filter used while advertising the refs to the client.
* <p>

Loading…
Отказ
Запис