Skip to main content

objects

Function objects 

Source
pub fn objects(common_dir: &Path, hash: Kind) -> Result<Handle>
Expand description

Opens the repository’s object database.

Shared rather than opened per question: status asks about the index and about history in one run, and two handles would mean two sets of open packs for the same objects.

hash is not optional and gix_odb::at is not usable. That convenience wrapper takes the default hash, which is SHA-1, and the store asserts the hash of every id handed to it. Measured on git 2.55 in a repository created with --object-format=sha256: git-xcrypt status panicked inside gix-odb, and so did the filter on the check-in path — which with required = true aborts every git operation in the repository. A tool this build already reads SHA-256 indexes for must not fall over on the object database.

§Errors

Error::Config when the database cannot be opened at all.