mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(config): add ability to delete variable
This commit is contained in:
parent
2cdcccefc9
commit
4988b295a5
3 changed files with 40 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue