Skip to main content

fetch

Function fetch 

Source
pub fn fetch(
    request: FetchRequest<'_>,
    services: FetchServices<'_>,
) -> Result<FetchOutcome>
Expand description

Fetch from a resolved source into the repository at git_dir.

Performs the work the CLI’s fetch_http_repository/fetch_local_repository did: applies configured tag/prune options, plans the ref-map for refspecs (empty means the remote’s configured fetch refspecs, falling back to HEAD), installs the pack, writes FETCH_HEAD, applies remote-tracking updates, and prunes. remote_name is the remote/argument the caller resolved source from (used for FETCH_HEAD descriptions and to look up remote.<name>.*).

Emits prune notices through progress and returns the structured FetchOutcome; never prints or returns GitError::Exit.