feat(config): add ability to delete variable

This commit is contained in:
Aleksey Kulikov 2021-06-16 17:12:32 +03:00
parent 2cdcccefc9
commit 4988b295a5
3 changed files with 40 additions and 3 deletions

View file

@ -129,6 +129,19 @@ class Config {
}
}
/// Deletes variable from the config file with the highest level
/// (usually the local one).
///
/// Throws a [LibGit2Error] if error occured.
void deleteVariable(String key) {
try {
config.deleteVariable(configPointer.value, key);
variables = config.getVariables(configPointer.value);
} catch (e) {
rethrow;
}
}
/// Releases memory allocated for config object.
void close() {
calloc.free(configPointer);