Skip to main content

config_unset_if_present

Function config_unset_if_present 

Source
pub fn config_unset_if_present(cwd: &Path, key: &str) -> Result<(), GitError>
Expand description

Idempotent variant of config_unset: succeeds even when the key is already absent.

disable-debug style operations want “ensure this key is gone” semantics — re-running on a repo that never had the key set should not fail. This helper swallows GitError::ConfigKeyNotSet and propagates every other error.

§Errors

Returns the same errors as config_unset except GitError::ConfigKeyNotSet, which is treated as success.