Class FetchRequest

java.lang.Object
org.eclipse.jgit.transport.FetchRequest
Direct Known Subclasses:
FetchV0Request, FetchV2Request

abstract class FetchRequest extends Object
Common fields between v0/v1/v2 fetch requests.
  • Field Details

    • wantIds

      final Set<ObjectId> wantIds
    • depth

      final int depth
    • clientShallowCommits

      final Set<ObjectId> clientShallowCommits
    • filterSpec

      final FilterSpec filterSpec
    • clientCapabilities

      final Set<String> clientCapabilities
    • deepenSince

      final int deepenSince
    • deepenNotRefs

      final List<String> deepenNotRefs
    • agent

      @Nullable final String 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 ids
      depth - how deep to go in the tree
      clientShallowCommits - commits the client has without history
      filterSpec - the filter spec
      clientCapabilities - capabilities sent in the request
      deepenSince - Requests that the shallow clone/fetch should be cut at a specific time, instead of depth
      deepenNotRefs - 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

      @NonNull Set<ObjectId> 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

      @NonNull Set<ObjectId> 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

      @NonNull FilterSpec getFilterSpec()
      Returns:
      the filter spec given in a "filter" line
    • getClientCapabilities

      @NonNull Set<String> 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 via getAgent().
      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

      @NonNull List<String> getDeepenNotRefs()
      Returns:
      refs received in "deepen-not" lines.
    • getAgent

      @Nullable String getAgent()
      Returns:
      string identifying the agent (as sent in the request body by the client)