Skip to main content

Module candidate_reader

Module candidate_reader 

Source
Expand description

The long-lived object reader that answers every blob read of an invocation. What: One long-lived git cat-file --batch process that answers every object read of an invocation. Why: Starting Git costs far more than reading one object, so candidate bytes are read through a single process whose count does not grow with the number of files. Blob bytes are remembered by object name: a name always denotes the same bytes, so a remembered blob can never become stale.

In TS you’d write (pseudocode):

// const reader = startObjectReader(git); const bytes = await reader.blob(oid);

Structs§

ObjectReader
What: A running object reader and the blobs it has already read. Option<ReaderPipes> is “open pipes or nothing”; nothing means closed. Rc<[u8]> is a shared read-only byte list. Why: One value owns the process for its whole life, so the process is always stopped and collected when the value is dropped.

Functions§

start_object_reader
What: Start the reader for the repository the caller’s global options select. &[OsString] borrows the arguments before the subcommand, unchanged; &[(OsString, OsString)] borrows added environment pairs. Result<T, E> is “a value or a failure”. Why: Replaying the global prefix makes the reader open the same repository as the forwarded command. The overlay may point it at a private object directory, so one reader is bound to one overlay for its whole life.