mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
feat(attr): add bindings and api
This commit is contained in:
parent
934b601d68
commit
ec80ad3dd4
5 changed files with 116 additions and 6 deletions
|
@ -236,5 +236,20 @@ void main() {
|
|||
signature.free();
|
||||
config.free();
|
||||
});
|
||||
|
||||
test('returns attribute value', () async {
|
||||
expect(repo.getAttribute(path: 'invalid', name: 'not-there'), null);
|
||||
|
||||
final attrFile = await File('${repo.workdir}.gitattributes').create();
|
||||
attrFile.writeAsString('*.dart text\n*.jpg -text\n*.sh eol=lf\n');
|
||||
|
||||
await File('${repo.workdir}file.dart').create();
|
||||
await File('${repo.workdir}file.sh').create();
|
||||
|
||||
expect(repo.getAttribute(path: 'file.dart', name: 'not-there'), null);
|
||||
expect(repo.getAttribute(path: 'file.dart', name: 'text'), true);
|
||||
expect(repo.getAttribute(path: 'file.jpg', name: 'text'), false);
|
||||
expect(repo.getAttribute(path: 'file.sh', name: 'eol'), 'lf');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue