Skip to main content

Module fetch

Module fetch 

Source
Expand description

Parallel fetch handler.

The remote-helper protocol delivers fetch commands as a batch terminated by a blank line (see gitremote-helpers(1)). The batch is serviced by a tokio::task::JoinSet bounded by a tokio::sync::Semaphore of [MAX_FETCH_CONCURRENCY] permits.

Per fetch:

  1. Download <prefix>/<ref>/<sha>.bundle to a private tempdir
  2. git bundle unbundle it for <ref> (subprocess, see crate::git)
  3. Mark the SHA as fetched in the session-wide [FetchedRefs] set so a second batch within the same REPL session skips work that has already happened.

Stdout discipline: this handler emits nothing on stdout. The trailing blank-line terminator is the REPL’s responsibility — see .claude/rules/protocol-stdout.md.

Enums§

FetchError
Errors surfaced by the fetch path.