A fetch connection typically connects to the git-upload-pack
service running where the remote repository is stored. This provides a
one-way object transfer service to copy objects from the remote repository
into this local repository.
Instances of a FetchConnection must be created by a
org. that implements a specific
object transfer protocol that both sides of the connection understand.
FetchConnection instances are not thread safe and may be accessed by only one thread at a time.
Transport
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the last fetch call implicitly included tag objects; false if tags were not implicitly obtained.Did the last |
| public boolean | Returns: true if the last fetch had to perform a connectivity check on the client side in order to succeed; false if the last fetch assumed the remote peer supplied a complete graph.Did the last |
| public void | fetch(final ProgressMonitor
progress monitor to inform the end-user about the amount of
work completed, or to indicate cancellation. Implementations
should poll the monitor at regular intervals to look for
cancellation requests from the user. monitor, final Collection<Ref> one or more refs advertised by this connection that the caller
wants to store locally. want, final Set<ObjectId> additional objects known to exist in the destination
repository, especially if they aren't yet reachable by the ref
database. Connections should take this set as an addition to
what is reachable through all Refs, not in replace of it. have)Fetch objects we don't have but that are reachable from advertised refs. |
| public void | fetch(final ProgressMonitor
progress monitor to inform the end-user about the amount of
work completed, or to indicate cancellation. Implementations
should poll the monitor at regular intervals to look for
cancellation requests from the user. monitor, final Collection<Ref> one or more refs advertised by this connection that the caller
wants to store locally. want, final Set<ObjectId> additional objects known to exist in the destination
repository, especially if they aren't yet reachable by the ref
database. Connections should take this set as an addition to
what is reachable through all Refs, not in replace of it. have, OutputStream OutputStream to write sideband messages to out)Fetch objects we don't have but that are reachable from advertised refs. |
| public Collection | Returns: collection (possibly empty) of locks created by the last call to fetch. The caller must release these after refs are updated in order to safely permit garbage collection.All locks created by the last
|
| public void | setPackLockMessage(String
message to use when holding a pack in place. message)Set the lock message used when holding a pack out of garbage collection. |
| didFetchIncludeTags | back to summary |
|---|---|
| public boolean didFetchIncludeTags() Did the last
Some Git aware transports are able to implicitly grab an annotated tag if
By returning only true/false (and not the actual list of tags obtained) the transport itself does not need to be aware of whether or not tags were included in the transfer.
| |
| didFetchTestConnectivity | back to summary |
|---|---|
| public boolean didFetchTestConnectivity() Did the last Some transports walk the object graph on the client side, with the client looking for what objects it is missing and requesting them individually from the remote peer. By virtue of completing the fetch call the client implicitly tested the object connectivity, as every object in the graph was either already local or was requested successfully from the peer. In such transports this method returns true. Some transports assume the remote peer knows the Git object graph and is able to supply a fully connected graph to the client (although it may only be transferring the parts the client does not yet have). Its faster to assume such remote peers are well behaved and send the correct response to the client. In such transports this method returns false.
| |
| fetch | back to summary |
|---|---|
| public void fetch(final ProgressMonitor monitor, final Collection<Ref> want, final Set<ObjectId> have) throws TransportException Fetch objects we don't have but that are reachable from advertised refs.
Only one call per connection is allowed. Subsequent calls will result in
Implementations are free to use network connections as necessary to
efficiently (for both client and server) transfer objects from the remote
repository into this repository. When possible implementations should
avoid replacing/overwriting/duplicating an object already available in
the local destination repository. Locally available objects and packs
should always be preferred over remotely available objects and packs.
| |
| fetch | back to summary |
|---|---|
| public void fetch(final ProgressMonitor monitor, final Collection<Ref> want, final Set<ObjectId> have, OutputStream out) throws TransportException Fetch objects we don't have but that are reachable from advertised refs.
Only one call per connection is allowed. Subsequent calls will result in
Implementations are free to use network connections as necessary to
efficiently (for both client and server) transfer objects from the remote
repository into this repository. When possible implementations should
avoid replacing/overwriting/duplicating an object already available in
the local destination repository. Locally available objects and packs
should always be preferred over remotely available objects and packs.
| |
| getPackLocks | back to summary |
|---|---|
| public Collection All locks created by the last
| |
| setPackLockMessage | back to summary |
|---|---|
| public void setPackLockMessage(String message) Set the lock message used when holding a pack out of garbage collection.
Callers that set a lock message must ensure they call
| |