refactor!: return sets of git type flags instead of integers

This commit is contained in:
Aleksey Kulikov 2021-09-10 20:22:02 +03:00
parent 050c0eb57a
commit 7618f944c0
12 changed files with 459 additions and 191 deletions

View file

@ -343,7 +343,13 @@ void main() {
final index = repo.index;
index.remove('file');
index.add('new_file.txt');
expect(repo.status, {'file': 132, 'new_file.txt': 1});
expect(
repo.status,
{
'file': {GitStatus.indexDeleted, GitStatus.wtNew},
'new_file.txt': {GitStatus.indexNew}
},
);
index.free();
});
@ -351,7 +357,11 @@ void main() {
test('returns status of a single file for provided path', () {
final index = repo.index;
index.remove('file');
expect(repo.statusFile('file'), 132);
expect(
repo.statusFile('file'),
{GitStatus.indexDeleted, GitStatus.wtNew},
);
expect(repo.statusFile('.gitignore'), {GitStatus.current});
index.free();
});