mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(reset): add ability to remove entries in index (#57)
This commit is contained in:
parent
16c42b9b2d
commit
faddaa52e2
3 changed files with 29 additions and 9 deletions
|
@ -61,6 +61,17 @@ void main() {
|
|||
expect(repo.status['feature_file'], {GitStatus.wtModified});
|
||||
});
|
||||
|
||||
test('removes entry in the index when null oid is provided', () {
|
||||
const fileName = 'new_file.txt';
|
||||
File(p.join(tmpDir.path, fileName)).createSync();
|
||||
|
||||
repo.index.add(fileName);
|
||||
expect(repo.status[fileName], {GitStatus.indexNew});
|
||||
|
||||
repo.resetDefault(oid: null, pathspec: [fileName]);
|
||||
expect(repo.status[fileName], {GitStatus.wtNew});
|
||||
});
|
||||
|
||||
test('throws when pathspec list is empty', () {
|
||||
expect(
|
||||
() => repo.resetDefault(oid: repo.head.target, pathspec: []),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue