public class ReceivePack extends BaseReceivePack
BaseReceivePack.FirstLine, BaseReceivePack.ReceiveConfig
Constructor and Description |
---|
ReceivePack(Repository into)
Create a new pack receive for an open repository.
|
Modifier and Type | Method and Description |
---|---|
protected void |
enableCapabilities()
Enable capabilities based on a previously read capabilities line.
|
protected String |
getLockMessageProcessName()
Get the process name used for pack lock messages.
|
PostReceiveHook |
getPostReceiveHook()
Get the hook invoked after updates occur.
|
PreReceiveHook |
getPreReceiveHook()
Get the hook invoked before updates occur.
|
List<String> |
getPushOptions()
Gets an unmodifiable view of the option strings associated with the push.
|
void |
receive(InputStream input,
OutputStream output,
OutputStream messages)
Execute the receive task on the socket.
|
void |
setEchoCommandFailures(boolean echo)
Set whether this class will report command failures as warning messages
before sending the command results.
|
void |
setPostReceiveHook(PostReceiveHook h)
Set the hook which is invoked after commands are executed.
|
void |
setPreReceiveHook(PreReceiveHook h)
Set the hook which is invoked prior to commands being executed.
|
void |
setPushOptions(List<String> options)
Set the push options supplied by the client.
|
anyRejects, close, executeCommands, failPendingCommands, filterCommands, getAdvertisedObjects, getAdvertisedOrDefaultRefs, getAdvertisedRefs, getAdvertiseRefsHook, getAllCommands, getClientShallowCommits, getMessageOutputStream, getPackSize, getPeerUserAgent, getPushCertificate, getReceivedPackStatistics, getRefFilter, getRefLogIdent, getRepository, getRevWalk, getTimeout, hasCommands, hasError, init, isAllowBranchDeletes, isAllowCreates, isAllowDeletes, isAllowNonFastForwards, isAllowPushOptions, isAllowQuiet, isAtomic, isBiDirectionalPipe, isCapabilityEnabled, isCheckReceivedObjects, isCheckReferencedObjectsAreReachable, isExpectDataAfterPackFooter, isQuiet, isSideBand, needPack, receivePackAndCheckConnectivity, recvCommands, release, sendAdvertisedRefs, sendError, sendMessage, sendStatusReport, setAdvertisedRefs, setAdvertiseRefsHook, setAllowBranchDeletes, setAllowCreates, setAllowDeletes, setAllowNonFastForwards, setAllowPushOptions, setAllowQuiet, setAtomic, setBiDirectionalPipe, setCheckReceivedObjects, setCheckReferencedObjectsAreReachable, setExpectDataAfterPackFooter, setMaxCommandBytes, setMaxCommandDiscardBytes, setMaxObjectSizeLimit, setMaxPackSizeLimit, setObjectChecker, setPushCertificate, setRefFilter, setRefLogIdent, setSignedPushConfig, setTimeout, unlockPack, validateCommands
public ReceivePack(Repository into)
into
- the destination repository.@Nullable public List<String> getPushOptions()
public void setPushOptions(@Nullable List<String> options)
Should only be called if reconstructing an instance without going through
the normal BaseReceivePack.recvCommands()
flow.
options
- the list of options supplied by the client. The
ReceivePack
instance takes ownership of this list.
Callers are encouraged to first create a copy if the list may
be modified later.public PreReceiveHook getPreReceiveHook()
public void setPreReceiveHook(PreReceiveHook h)
Only valid commands (those which have no obvious errors according to the
received input and this instance's configuration) are passed into the
hook. The hook may mark a command with a result of any value other than
ReceiveCommand.Result.NOT_ATTEMPTED
to
block its execution.
The hook may be called with an empty command collection if the current set is completely invalid.
h
- the hook instance; may be null to disable the hook.public PostReceiveHook getPostReceiveHook()
public void setPostReceiveHook(PostReceiveHook h)
Only successful commands (type is
ReceiveCommand.Result.OK
) are passed
into the hook. The hook may be called with an empty command collection if
the current set all resulted in an error.
h
- the hook instance; may be null to disable the hook.public void setEchoCommandFailures(boolean echo)
echo
- if true this class will report command failures as warning
messages before sending the command results. This is usually
not necessary, but may help buggy Git clients that discard the
errors when all branches fail.public void receive(InputStream input, OutputStream output, OutputStream messages) throws IOException
input
- raw input to read client commands and pack data from. Caller
must ensure the input is buffered, otherwise read performance
may suffer.output
- response back to the Git network client. Caller must ensure
the output is buffered, otherwise write performance may
suffer.messages
- 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.IOException
protected void enableCapabilities()
enableCapabilities
in class BaseReceivePack
protected String getLockMessageProcessName()
getLockMessageProcessName
in class BaseReceivePack
Copyright © 2018 Eclipse JGit Project. All rights reserved.