Skip to main content

show_capped

Function show_capped 

Source
async fn show_capped(
    cwd: &Path,
    spec: &str,
    ceiling: usize,
    budget: Duration,
) -> Option<Vec<u8>>
Expand description

git show <spec>, at most ceiling bytes of its stdout and never a byte more: the child is killed the moment the ceiling is reached, so what this allocates is the ceiling’s, not the file’s. None when the child could not start, the budget cut the read off, or it ended in failure - a git show that failed after the size probe answered is a read that did not happen, never an empty file.