mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(repository): add ability to get repository config
This commit is contained in:
parent
0194d7c361
commit
594aca6474
7 changed files with 145 additions and 54 deletions
|
@ -1,4 +1,5 @@
|
|||
import 'dart:ffi';
|
||||
import 'config.dart';
|
||||
import 'index.dart';
|
||||
import 'odb.dart';
|
||||
import 'oid.dart';
|
||||
|
@ -188,6 +189,26 @@ class Repository {
|
|||
libgit2.git_libgit2_shutdown();
|
||||
}
|
||||
|
||||
/// Returns the configuration file for this repository.
|
||||
///
|
||||
/// If a configuration file has not been set, the default config set for the repository
|
||||
/// will be returned, including global and system configurations (if they are available).
|
||||
///
|
||||
/// The configuration file must be freed once it's no longer being used by the user.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Config get config => Config(bindings.config(_repoPointer));
|
||||
|
||||
/// Returns a snapshot of the repository's configuration.
|
||||
///
|
||||
/// Convenience function to take a snapshot from the repository's configuration.
|
||||
/// The contents of this snapshot will not change, even if the underlying config files are modified.
|
||||
///
|
||||
/// The configuration file must be freed once it's no longer being used by the user.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Config get configSnapshot => Config(bindings.configSnapshot(_repoPointer));
|
||||
|
||||
/// Returns [Reference] object pointing to repository head.
|
||||
///
|
||||
/// Must be freed once it's no longer being used.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue