mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 12:19:09 -04:00
feat: prototype config api
This commit is contained in:
parent
0fe3fa9f23
commit
1c6c5579d7
5 changed files with 253 additions and 1 deletions
17
example/config_example.dart
Normal file
17
example/config_example.dart
Normal file
|
@ -0,0 +1,17 @@
|
|||
import 'package:libgit2dart/libgit2dart.dart';
|
||||
|
||||
void main() {
|
||||
final repoConfig = Config(path: '.git/config');
|
||||
|
||||
final isBare = repoConfig.getBool('core.bare');
|
||||
final isLoggingAllRefUpdates = repoConfig.getBool('core.logallrefupdates');
|
||||
final repoFormatVersion = repoConfig.getInt('core.repositoryformatversion');
|
||||
final remoteOriginUrl = repoConfig.getString('remote.origin.url');
|
||||
|
||||
print('Repository is bare = $isBare');
|
||||
print('Logging all ref updates = $isLoggingAllRefUpdates');
|
||||
print('Repository format version = $repoFormatVersion');
|
||||
print('Remote origin url = $remoteOriginUrl');
|
||||
|
||||
repoConfig.close();
|
||||
}
|
|
@ -4,5 +4,5 @@ import 'package:libgit2dart/libgit2dart.dart';
|
|||
|
||||
void main() {
|
||||
final repo = Repository.open(Directory.current.path);
|
||||
print(repo.path);
|
||||
print('Path to git repository: ${repo.path}');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue