Package org.eclipse.jgit.transport
Class FetchRequest
java.lang.Object
org.eclipse.jgit.transport.FetchRequest
- Direct Known Subclasses:
FetchV0Request
,FetchV2Request
Common fields between v0/v1/v2 fetch requests.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final String
(package private) final int
(package private) final int
(package private) final FilterSpec
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) String
getAgent()
Capabilities that the client wants enabled from the server.Shallow commits the client already has.(package private) int
The value in a "deepen-since" line in the request, indicating the timestamp where to stop fetching/cloning.(package private) int
getDepth()
(package private) FilterSpec
-
Field Details
-
wantIds
-
depth
final int depth -
clientShallowCommits
-
filterSpec
-
clientCapabilities
-
deepenSince
final int deepenSince -
deepenNotRefs
-
agent
-
-
Constructor Details
-
FetchRequest
FetchRequest(@NonNull Set<ObjectId> wantIds, int depth, @NonNull Set<ObjectId> clientShallowCommits, @NonNull FilterSpec filterSpec, @NonNull Set<String> clientCapabilities, int deepenSince, @NonNull List<String> deepenNotRefs, @Nullable String agent) Initialize the common fields of a fetch request.- Parameters:
wantIds
- list of want idsdepth
- how deep to go in the treeclientShallowCommits
- commits the client has without historyfilterSpec
- the filter specclientCapabilities
- capabilities sent in the requestdeepenSince
- Requests that the shallow clone/fetch should be cut at a specific time, instead of depthdeepenNotRefs
- Requests that the shallow clone/fetch should be cut at these specific revisions instead of a depth.agent
- agent as reported by the client in the request body
-
-
Method Details
-
getWantIds
- Returns:
- object ids in the "want" (and "want-ref") lines of the request
-
getDepth
int getDepth()- Returns:
- the depth set in a "deepen" line. 0 by default.
-
getClientShallowCommits
Shallow commits the client already has. These are sent by the client in "shallow" request lines.- Returns:
- set of commits the client has declared as shallow.
-
getFilterSpec
- Returns:
- the filter spec given in a "filter" line
-
getClientCapabilities
Capabilities that the client wants enabled from the server. Capabilities are options that tune the expected response from the server, like "thin-pack", "no-progress" or "ofs-delta". This list should be a subset of the capabilities announced by the server in its first response. These options are listed and well-defined in the git protocol specification. The agent capability is not included in this set. It can be retrieved viagetAgent()
.- Returns:
- capabilities sent by the client (excluding the "agent" capability)
-
getDeepenSince
int getDeepenSince()The value in a "deepen-since" line in the request, indicating the timestamp where to stop fetching/cloning.- Returns:
- timestamp in seconds since the epoch, where to stop the shallow fetch/clone. Defaults to 0 if not set in the request.
-
getDeepenNotRefs
- Returns:
- refs received in "deepen-not" lines.
-
getAgent
- Returns:
- string identifying the agent (as sent in the request body by the client)
-