feat(index): add ability to pass options to addAll(...) API method (#68)

This commit is contained in:
Aleksey Kulikov 2022-06-17 14:52:46 +03:00 committed by GitHub
parent d113af44b5
commit aa073c531e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 4 deletions

View file

@ -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);
});
}

View file

@ -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);