| Modifier and Type | Class and Description |
|---|---|
| private class | |
| pack-priv class | ReceivePack.
Output stream that wraps the current |
| private class | |
| private static class | ReceivePack.
Configuration for receive operations. |
| pack-priv abstract static class | ReceivePack.
Interface for reporting status messages. |
| Modifier and Type | Field and Description |
|---|---|
| private Set | advertisedHaves
All SHA-1s shown to the client, which can be possible edges. |
| private StringBuilder | |
| private AdvertiseRefsHook | advertiseRefsHook
Hook used while advertising the refs to the client. |
| private boolean | allowAnyDeletes
Should an incoming transfer permit delete requests? |
| private boolean | |
| private boolean | allowCreates
Should an incoming transfer permit create requests? |
| private boolean | allowNonFastForwards
Should an incoming transfer permit non-fast-forward requests? |
| private boolean | |
| private boolean | allowPushOptions
Should an incoming transfer permit push options? |
| private boolean | |
| private boolean | allowReceiveClientSID
Should the server advertise and accept the session-id capability. |
| private boolean | atomic
Should the requested ref updates be performed as a single atomic transaction? |
| private boolean | biDirectionalPipe
Is the client connection a bi-directional socket or pipe? |
| private boolean | |
| private Set | |
| private String | clientSID
Session ID sent from the client. |
| private List | |
| protected ConnectivityChecker | connectivityChecker
Connectivity checker to use. |
| private final Repository | db
Database we write the stored objects into. |
| private Map | enabledCapabilities
Capabilities requested by the client. |
| private SideBandOutputStream | |
| private boolean | expectDataAfterPackFooter
Expecting data after the pack footer |
| private long | |
| private long | |
| private long | maxObjectSizeLimit
Git object size limit |
| private long | maxPackSizeLimit
Total pack size limit |
| private OutputStream | msgOut
Optional message output stream. |
| private final ReceivePack. | |
| private ObjectChecker | objectChecker
Should an incoming transfer validate objects? |
| private OutputStream | |
| private PackLock | packLock
Lock around the received pack file, while updating refs. |
| private Long | packSize
The size of the received pack, including index size |
| private PackParser | |
| private PacketLineIn | |
| private PacketLineOut | |
| private PostReceiveHook | postReceive
Hook to report on the commands after execution. |
| private PreReceiveHook | preReceive
Hook to validate the update commands before execution. |
| private PushCertificate | |
| private PushCertificateParser | |
| private List | |
| private boolean | |
| private InputStream | rawIn
Raw input stream. |
| private OutputStream | rawOut
Raw output stream. |
| private ReceiveCommandErrorHandler | |
| private RefFilter | refFilter
Filter used while advertising the refs to the client. |
| private PersonIdent | refLogIdent
Identity to record action as within the reflog. |
| private Map | refs
The refs we advertised as existing at the start of the connection. |
| private boolean | reportStatus
If |
| private boolean | sideBand
If |
| private SignedPushConfig | |
| private ReceivedPackStatistics | |
| private int | timeout
Timeout in seconds to wait for client interaction. |
| private TimeoutInputStream | |
| private InterruptTimer | |
| private UnpackErrorHandler | |
| private boolean | usePushOptions
Whether the client intends to use push options. |
| pack-priv String | |
| private final RevWalk |
| Access | Constructor and Description |
|---|---|
| public | ReceivePack(Repository
the destination repository. into)Create a new pack receive for an open repository. |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | Returns: if any commands have been rejected so far.Whether any commands have been rejected so far. |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private ConnectivityChecker. | |
| private void | |
| private void | |
| protected void | |
| private void | |
| private void | |
| protected List | Returns: a copy of the command list containing only those commands with the desired status.desired status to filter by. wantFilter the list of commands according to result. |
| public final Set | Returns: the set of objects advertised to the as present in this repository, or null ifsetAdvertisedRefs(Map, Set) has
not been called yet.Get objects advertised to the client. |
| private Map | Returns: advertised refs, or the default if not explicitly advertised.Get advertised refs, or the default if not explicitly advertised. |
| public Map | Returns: all refs which were advertised to the client, or null ifsetAdvertisedRefs(Map, Set) has not been called yet.Get refs which were advertised to the client. |
| public AdvertiseRefsHook | Returns: the hook used while advertising the refs to the clientGet the hook used while advertising the refs to the client |
| public List | Returns: all of the command received by the current request.Get all of the command received by the current request. |
| private Map | |
| private Set | Returns: if the client is a shallow repository, the list of edge commits that define the client's shallow boundary. Empty set if the client is earlier than Git 1.9, or is a full clone.Get the commits from the client's shallow file. |
| public String | |
| public OutputStream | Returns: an underlying stream for sending messages to the client.Get an underlying stream for sending messages to the client. |
| public long | Returns: the size of the received pack including index sizeGet the size of the received pack file including the index size. |
| public String | Returns: user agent supplied by the client. Available only if the client is new enough to advertise its user agent.Get the user agent of the client. |
| public PostReceiveHook | Returns: the hook invoked after updates occur.Get the hook invoked after updates occur. |
| public PreReceiveHook | Returns: the hook invoked before updates occur.Get the hook invoked before updates occur. |
| public PushCertificate | Returns: the parsed certificate, or null if push certificates are disabled or no cert was presented by the client.Get the push certificate used to verify the pusher's identity. |
| private PushCertificateParser | |
| public List | Returns: an unmodifiable view of pushOptions, or null (if pushOptions is).Gets an unmodifiable view of the option strings associated with the push. |
| public ReceivedPackStatistics | Returns: ReceivedPackStatisticsReturns the statistics on the received pack if available. |
| public RefFilter | Returns: the filter used while advertising the refs to the clientGet the filter used while advertising the refs to the client |
| public PersonIdent | Returns: identity of the user making the changes in the reflog.Get identity of the user making the changes in the reflog. |
| public Repository | Returns: the repository this receive completes into.Get the repository this receive completes into. |
| public RevWalk | Returns: the RevWalk instance used by this connection.Get the RevWalk instance used by this connection. |
| public int | Returns: timeout (in seconds) before aborting an IO operation.Get timeout (in seconds) before aborting an IO operation. |
| public UnpackErrorHandler | Returns: the current unpack error handler.Get the current unpack error handler. |
| private boolean | Returns: true if any commands to be executed have been read.Whether any commands to be executed have been read. |
| private boolean | Returns: true if an error occurred that should be advertised.Whether an error occurred that should be advertised. |
| public boolean | Returns: true if a pack has been received.Get whether or not a pack has been received. |
| protected void | init(final InputStream
raw input to read client commands and pack data from. Caller
must ensure the input is buffered, otherwise read performance
may suffer. input, final OutputStream response back to the Git network client. Caller must ensure
the output is buffered, otherwise write performance may
suffer. output, final OutputStream secondary "notice" channel to send additional messages out
through. When run over SSH this should be tied back to the
standard error channel of the command execution. For most
other network connections this should be null. messages)Initialize the instance with the given streams. |
| public boolean | Returns: true if the client can delete from refs/heads/.Whether the client can delete from |
| public boolean | Returns: true if the client can request refs to be created.Whether the client can request refs to be created. |
| public boolean | Returns: true if the client can request refs to be deleted.Whether the client can request refs to be deleted. |
| public boolean | Returns: true if the client can request non-fast-forward updates
of a ref, possibly making objects unreachable.Whether the client can request non-fast-forward updates of a ref, possibly making objects unreachable. |
| public boolean | Returns: true if the server supports receiving push options.Whether the server supports receiving push options. |
| public boolean | Returns: true if clients may request avoiding noisy progress messages.Whether clients may request avoiding noisy progress messages. |
| public boolean | Returns: true if the client's commands should be performed as a
single atomic transaction.Whether the client's commands should be performed as a single atomic transaction. |
| public boolean | Returns: true if this class expects a bi-directional pipe opened between the client and itself. The default is true.Whether this class expects a bi-directional pipe opened between the client and itself. |
| private boolean | Returns: true if the peer requested the capability to be enabled.protocol name identifying the capability. name)Check if the peer requested a capability. |
| public boolean | Returns: true if this instance will verify received objects are
formatted correctly. Validating objects requires more CPU time on
this side of the connection.Whether this instance will verify received objects are formatted correctly. |
| public boolean | Returns: true if this instance will validate all referenced, but not supplied by the client, objects are reachable from another reference.Whether this instance will validate all referenced, but not supplied by the client, objects are reachable from another reference. |
| public boolean | Returns: true if there is data expected after the pack footer.Whether there is data expected after the pack footer. |
| public boolean | Returns: true if the client has requested the server to be less verbose.True if the client wants less verbose output. |
| public boolean | Returns: true if the client has advertised a side-band capability, false otherwise.Check whether the client expects a side-band stream. |
| private boolean | |
| private boolean | Returns: true if a pack is expected based on the list of commands.Whether a pack is expected based on the list of commands. |
| private InputStream | |
| pack-priv static ReceiveCommand | |
| private void | |
| pack-priv void | |
| public void | receive(final InputStream
raw input to read client commands and pack data from. Caller
must ensure the input is buffered, otherwise read performance
may suffer. input, final OutputStream response back to the Git network client. Caller must ensure
the output is buffered, otherwise write performance may
suffer. output, final OutputStream secondary "notice" channel to send additional messages out
through. When run over SSH this should be tied back to the
standard error channel of the command execution. For most
other network connections this should be null. messages)Execute the receive task on the socket. |
| private void | |
| protected void | receivePackAndCheckConnectivity()
Receive a pack from the stream and check connectivity if necessary. |
| public void | receiveWithExceptionPropagation(InputStream
raw input to read client commands and pack data from. Caller
must ensure the input is buffered, otherwise read performance
may suffer. input, OutputStream response back to the Git network client. Caller must ensure
the output is buffered, otherwise write performance may
suffer. output, OutputStream secondary "notice" channel to send additional messages out
through. When run over SSH this should be tied back to the
standard error channel of the command execution. For most
other network connections this should be null. messages)Execute the receive task on the socket. |
| private void | |
| private void | |
| public void | sendAdvertisedRefs(RefAdvertiser
the advertisement formatter. adv)Generate an advertisement of available refs and capabilities. |
| public void | |
| public void | sendMessage(String
string describing the problem identified by the hook. The
string must not end with an LF, and must not contain an LF. what)Send a message to the client, if it supports receiving them. |
| private void | sendStatusReport(Throwable
an error that occurred during unpacking, or unpackError)nullSend a status report. |
| private void | |
| public void | setAdvertisedRefs(Map<String, Ref>
explicit set of references to claim as advertised by this
ReceivePack instance. This overrides any references that may
exist in the source repository. The map is passed to the
configured allRefs, Set<ObjectId> getRefFilter(). If null, assumes all refs
were advertised.explicit set of additional haves to claim as advertised. If
null, assumes the default set of additional haves from the
repository. additionalHaves)Set the refs advertised by this ReceivePack. |
| public void | setAdvertiseRefsHook(AdvertiseRefsHook
the hook; may be null to show all refs. advertiseRefsHook)Set the hook used while advertising the refs to the client. |
| public void | setAllowBranchDeletes(boolean
true to permit deletion of branches from the
refs/heads/ namespace.Configure whether to permit deletion of branches from the
|
| public void | setAllowCreates(boolean
true to permit create ref commands to be processed.Whether to permit create ref commands to be processed. |
| public void | setAllowDeletes(boolean
true to permit delete ref commands to be processed.Whether to permit delete ref commands to be processed. |
| public void | setAllowNonFastForwards(boolean
true to permit the client to ask for non-fast-forward
updates of an existing ref.Configure whether to permit the client to ask for non-fast-forward updates of an existing ref. |
| public void | setAllowPushOptions(boolean
true to optionally accept option strings from the client. allow)Configure if the server supports receiving push options. |
| public void | setAllowQuiet(boolean
true to allow clients to request quiet behavior; false to
refuse quiet behavior and send messages anyway. This may be
necessary if processing is slow and the client-server network
connection can timeout. allow)Configure if clients may request the server skip noisy messages. |
| public void | setAtomic(boolean
true to perform the client's commands as a single
atomic transaction.Configure whether to perform the client's commands as a single atomic transaction. |
| public void | setBiDirectionalPipe(boolean
if true, this class will assume the socket is a fully
bidirectional pipe between the two peers and takes advantage
of that by first transmitting the known refs, then waiting to
read commands. If false, this class assumes it must read the
commands before writing output and does not perform the
initial advertising. twoWay)Whether this class will assume the socket is a fully bidirectional pipe between the two peers and takes advantage of that by first transmitting the known refs, then waiting to read commands. |
| public void | setCheckReceivedObjects(boolean
true to enable checking received objects; false to
assume all received objects are valid.Whether to enable checking received objects |
| public void | setCheckReferencedObjectsAreReachable(boolean
true to enable the additional check.Validate all referenced but not supplied objects are reachable. |
| public void | setExpectDataAfterPackFooter(boolean
true if there is additional data in InputStream after
pack.Whether there is additional data in InputStream after pack. |
| public void | setMaxCommandBytes(long
command limit in bytes; if 0 there is no limit. limit)Set the maximum number of command bytes to read from the client. |
| public void | setMaxCommandDiscardBytes(long
discard limit in bytes; if 0 there is no limit; if -1 the
implementation tries to set a reasonable default. limit)Set the maximum number of command bytes to discard from the client. |
| public void | setMaxObjectSizeLimit(long
the Git object size limit. If zero then there is not limit. limit)Set the maximum allowed Git object size. |
| public void | |
| public void | setObjectChecker(ObjectChecker
if non-null the object checking instance to verify each
received object with; null to disable object checking. impl)Set the object checking instance to verify each received object with |
| public void | setPostReceiveHook(PostReceiveHook
the hook instance; may be null to disable the hook. h)Set the hook which is invoked after commands are executed. |
| public void | setPreReceiveHook(PreReceiveHook
the hook instance; may be null to disable the hook. h)Set the hook which is invoked prior to commands being executed. |
| public void | setPushCertificate(PushCertificate
the push certificate to set. cert)Set the push certificate used to verify the pusher's identity. |
| public void | setPushOptions(List<String>
the list of options supplied by the client. The
options)ReceivePack instance takes ownership of this list.
Callers are encouraged to first create a copy if the list may
be modified later.Set the push options supplied by the client. |
| public void | setReceiveCommandErrorHandler(ReceiveCommandErrorHandler
the error handler receiveCommandErrorHandler)Set an error handler for |
| public void | setRefFilter(RefFilter
the filter; may be null to show all refs. refFilter)Set the filter used while advertising the refs to the client. |
| public void | setRefLogIdent(PersonIdent
identity of the user. If null the identity will be
automatically determined based on the repository
configuration. pi)Set the identity of the user appearing in the affected reflogs. |
| public void | setSignedPushConfig(SignedPushConfig
new configuration; if this object is null or its
cfg)SignedPushConfig#getCertNonceSeed() is null, push
certificate verification will be disabled.Set the configuration for push certificate verification. |
| public void | setTimeout(int
number of seconds to wait (with no data transfer occurring)
before aborting an IO read or write operation with the
connected client. seconds)Set the timeout before willing to abort an IO call. |
| public void | setUnpackErrorHandler(UnpackErrorHandler
the unpackErrorHandler unpackErrorHandler)Set the unpackErrorHandler |
| private void | |
| private void |