Skip to main content

config_add_many

Function config_add_many 

Source
pub fn config_add_many(
    cwd: &Path,
    entries: &[(&str, &str)],
) -> Result<(), GitError>
Expand description

Batched variant of config_add: applies every (key, value) entry to the local config in a single read / parse / lock / write cycle.

Used by lfs::install::install, which previously paid two full gix::discover + fs::read + parse + lock + write cycles to set lfs.customtransfer.<agent>.path and lfs.standalonetransferagent back to back. All entries are validated up front, so a malformed later entry does not partially-write the file.

ยงErrors

Returns GitError::ConfigKeyParse for a malformed dotted key, GitError::ConfigInvalidValueName if a value name is rejected by gix-config, GitError::ConfigInvalidSectionName if a section name is rejected, GitError::Discover if the repository cannot be located, GitError::ConfigParse if the existing config cannot be parsed, GitError::ConfigLock if the lock cannot be acquired, or GitError::Io for other file I/O failures.