mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
feat(repository): add extended options to repository init
This commit is contained in:
parent
ec8ff24e89
commit
b1f112a30d
4 changed files with 155 additions and 11 deletions
|
@ -20,16 +20,36 @@ void main() {
|
|||
});
|
||||
group('Repository.init', () {
|
||||
test('successfully creates new bare repo at provided path', () {
|
||||
repo = Repository.init(initDir.path, isBare: true);
|
||||
repo = Repository.init(path: initDir.path, bare: true);
|
||||
|
||||
expect(repo.path, '${initDir.path}/');
|
||||
expect(repo.isBare, true);
|
||||
});
|
||||
|
||||
test('successfully creates new standard repo at provided path', () {
|
||||
repo = Repository.init(initDir.path);
|
||||
repo = Repository.init(path: initDir.path);
|
||||
|
||||
expect(repo.path, '${initDir.path}/.git/');
|
||||
expect(repo.isBare, false);
|
||||
expect(repo.isEmpty, true);
|
||||
});
|
||||
|
||||
test('successfully creates new standard repo with provided options', () {
|
||||
repo = Repository.init(
|
||||
path: initDir.path,
|
||||
description: 'test repo',
|
||||
originUrl: 'test.url',
|
||||
flags: {GitRepositoryInit.mkdir, GitRepositoryInit.mkpath},
|
||||
);
|
||||
|
||||
expect(repo.path, '${initDir.path}/.git/');
|
||||
expect(repo.isBare, false);
|
||||
expect(repo.isEmpty, true);
|
||||
expect(
|
||||
File('${initDir.path}/.git/description').readAsStringSync(),
|
||||
'test repo',
|
||||
);
|
||||
expect(repo.remotes['origin'].url, 'test.url');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue