Skip to main content

install_pack_path

Function install_pack_path 

Source
pub fn install_pack_path(
    pack_path: &Path,
    odb: &Odb,
    opts: &IngestPackOptions,
) -> Result<IngestedPack>
Expand description

Install a pack from pack_path into odb’s objects/pack/ directory.

The file is moved into place when possible; callers may pass a temp receive path under objects/pack/. Newly published .pack, .idx, and .rev sidecars are made read-only (respecting umask and core.sharedRepository).

Several threads or processes may install the same pack into one repository at once (parallel fetches): each stages under its own name, and a .pack/.idx already published under the same content-addressed name is kept, freshened, and reported as success rather than replaced. A failed or cancelled install removes only its private staging files, never a published .pack or .idx, because a concurrent installer may already have reported success relying on it.