mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(index): add ability to pass options to addAll(...)
API method (#68)
This commit is contained in:
parent
d113af44b5
commit
aa073c531e
5 changed files with 47 additions and 4 deletions
|
@ -551,4 +551,15 @@ void main() {
|
|||
expect(actual, expected);
|
||||
});
|
||||
});
|
||||
|
||||
test('GitIndexAddOption returns correct values', () {
|
||||
const expected = {
|
||||
GitIndexAddOption.defaults: 0,
|
||||
GitIndexAddOption.force: 1,
|
||||
GitIndexAddOption.disablePathspecMatch: 2,
|
||||
GitIndexAddOption.checkPathspec: 4,
|
||||
};
|
||||
final actual = {for (final e in GitIndexAddOption.values) e: e.value};
|
||||
expect(actual, expected);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -175,7 +175,10 @@ void main() {
|
|||
group('addAll()', () {
|
||||
test('adds with provided pathspec', () {
|
||||
index.clear();
|
||||
index.addAll(['file', 'feature_file']);
|
||||
index.addAll(
|
||||
['file', 'feature_file'],
|
||||
flags: {GitIndexAddOption.checkPathspec, GitIndexAddOption.force},
|
||||
);
|
||||
|
||||
expect(index.length, 2);
|
||||
expect(index['file'].oid.sha, fileSha);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue