feat(commit): add binding and API method for git_revert (#30)

This commit is contained in:
Aleksey Kulikov 2021-12-23 11:40:29 +03:00 committed by GitHub
parent fda5173e7f
commit 74a20a9cf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 0 deletions

View file

@ -665,6 +665,17 @@ class Repository {
);
}
/// Reverts the given [commit], producing changes in the index and working
/// directory.
///
/// Throws a [LibGit2Error] if error occured.
void revert(Commit commit) {
commit_bindings.revert(
repoPointer: _repoPointer,
commitPointer: commit.pointer,
);
}
/// Finds a single object and intermediate reference (if there is one) by a
/// [spec] revision string.
///