mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(repository): add ability to discover repository from sub directories
This commit is contained in:
parent
da8494d3e2
commit
543ebff223
4 changed files with 53 additions and 1 deletions
|
@ -149,6 +149,18 @@ void main() {
|
|||
config.free();
|
||||
});
|
||||
|
||||
group('.discover()', () {
|
||||
test('discovers repository', () async {
|
||||
final subDir = '${tmpDir}subdir1/subdir2/';
|
||||
await Directory(subDir).create(recursive: true);
|
||||
expect(Repository.discover(subDir), repo.path);
|
||||
});
|
||||
|
||||
test('returns empty string when repository not found', () {
|
||||
expect(Repository.discover(Directory.systemTemp.path), '');
|
||||
});
|
||||
});
|
||||
|
||||
test('returns empty string when there is no namespace', () {
|
||||
expect(repo.namespace, isEmpty);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue