This transport is suitable for use on the local system, where the caller has direct read or write access to the "remote" repository.
By default this transport works by spawning a helper thread within the same JVM, and processes the data transfer using a shared memory buffer between the calling thread and the helper thread. This is a pure-Java implementation which does not require forking an external process.
However, during openFetch(), if the Transport has configured
Transport#getOptionUploadPack() to be anything other than
"git-upload-pack" or "git upload-pack", this
implementation will fork and execute the external process, using an operating
system pipe to transfer data.
Similarly, during openPush(), if the Transport has configured
Transport#getOptionReceivePack() to be anything other than
"git-receive-pack" or "git receive-pack", this
implementation will fork and execute the external process, using an operating
system pipe to transfer data.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | |
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final TransportProtocol | |
| private final File |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| pack-priv ReceivePack | |
| pack-priv UploadPack | |
| public FetchConnection | openFetch()
Implements abstract org. Begins a new connection for fetching from the remote repository. |
| public FetchConnection | openFetch(Collection<RefSpec>
that will be fetched via
refSpecs, String... FetchConnection#fetch(ProgressMonitor, Collection, java. laterthat will be set as ref prefixes if the server supports git
protocol V2; additionalPatterns)null values are ignoredOverrides org. Begins a new connection for fetching from the remote repository. |
| public PushConnection | openPush()
Implements abstract org. Begins a new connection for pushing into the remote repository. |
| private Repository | |
| protected Process | |
| private Process | Returns: ajava. object.command cmd, TransferConfig.to use protocolVersionSpawn process |
| PROTO_LOCAL | back to summary |
|---|---|
| pack-priv static final TransportProtocol PROTO_LOCAL | |
| remoteGitDir | back to summary |
|---|---|
| private final File remoteGitDir | |
| TransportLocal | back to summary |
|---|---|
| pack-priv TransportLocal(Repository local, URIish uri, File gitDir) | |
| TransportLocal | back to summary |
|---|---|
| pack-priv TransportLocal(URIish uri, File gitDir) | |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements java. Doc from org. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
Close any resources used by this transport. If the remote repository is contacted by a network socket this method must close that network socket, disconnecting the two peers. If the remote repository is actually local (same system) this method must close any open file handles used to read the "remote" repository.
| |
| createReceivePack | back to summary |
|---|---|
| pack-priv ReceivePack createReceivePack(Repository dst) | |
| createUploadPack | back to summary |
|---|---|
| pack-priv UploadPack createUploadPack(Repository dst) | |
| openFetch | back to summary |
|---|---|
| public FetchConnection openFetch() throws TransportException Implements abstract org. Doc from org. Begins a new connection for fetching from the remote repository. If the transport has no local repository, the fetch connection can only be used for reading remote refs.
| |
| openFetch | back to summary |
|---|---|
| public FetchConnection openFetch(Collection<RefSpec> refSpecs, String... additionalPatterns) throws TransportException Overrides org. Doc from org. Begins a new connection for fetching from the remote repository. If the transport has no local repository, the fetch connection can only be used for reading remote refs.
If the server supports git protocol V2, the
Transports that want to support git protocol V2 must override
this; the default implementation ignores its arguments and calls
| |
| openPush | back to summary |
|---|---|
| public PushConnection openPush() throws TransportException Implements abstract org. Doc from org. Begins a new connection for pushing into the remote repository.
| |
| openRepo | back to summary |
|---|---|
| private Repository openRepo() throws TransportException | |
| spawn | back to summary |
|---|---|
| protected Process spawn(String cmd) throws TransportException Spawn process
| |
| spawn | back to summary |
|---|---|
| private Process spawn(String cmd, TransferConfig. Spawn process
| |
| Modifier and Type | Field and Description |
|---|---|
| private Thread | |
| private Process |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides org. Implements org. Closes this resource, relinquishing any underlying resources. |
| errorReaderThread | back to summary |
|---|---|
| private Thread errorReaderThread | |
| uploadPack | back to summary |
|---|---|
| private Process uploadPack | |
| ForkLocalFetchConnection | back to summary |
|---|---|
| pack-priv ForkLocalFetchConnection() throws TransportException | |
| ForkLocalFetchConnection | back to summary |
|---|---|
| pack-priv ForkLocalFetchConnection(Collection<RefSpec> refSpecs, String... additionalPatterns) throws TransportException | |
| close | back to summary |
|---|---|
| public void close() Overrides org. Implements org. Doc from org. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
Close any resources used by this connection. If the remote repository is contacted by a network socket this method must close that network socket, disconnecting the two peers. If the remote repository is actually local (same system) this method must close any open file handles used to read the "remote" repository.
If additional messages were produced by the remote peer, these should
still be retained in the connection instance for
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides org. Implements org. Closes this resource, relinquishing any underlying resources. |
| errorReaderThread | back to summary |
|---|---|
| private Thread errorReaderThread | |
| receivePack | back to summary |
|---|---|
| private Process receivePack | |
| ForkLocalPushConnection | back to summary |
|---|---|
| pack-priv ForkLocalPushConnection() throws TransportException | |
| close | back to summary |
|---|---|
| public void close() Overrides org. Implements org. Doc from org. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
Close any resources used by this connection. If the remote repository is contacted by a network socket this method must close that network socket, disconnecting the two peers. If the remote repository is actually local (same system) this method must close any open file handles used to read the "remote" repository.
If additional messages were produced by the remote peer, these should
still be retained in the connection instance for
| |