MCPcopy Create free account
hub / github.com/libgit2/pygit2 / revert

Method revert

pygit2/repository.py:1601–1612  ·  view source on GitHub ↗

Revert the given commit, producing changes in the index and working directory. This operation updates the repository's state and prepared message (MERGE_MSG).

(self, commit: Commit)

Source from the content-addressed store, hash-verified

1599 check_error(err)
1600
1601 def revert(self, commit: Commit) -> None:
1602 """
1603 Revert the given commit, producing changes in the index and working
1604 directory.
1605
1606 This operation updates the repository's state and prepared message
1607 (MERGE_MSG).
1608 """
1609 commit_ptr = ffi.new('git_commit **')
1610 ffi.buffer(commit_ptr)[:] = commit._pointer[:]
1611 err = C.git_revert(self._repo, commit_ptr[0], ffi.NULL)
1612 check_error(err)
1613
1614 def revert_commit(
1615 self, revert_commit: Commit, our_commit: Commit, mainline: int = 0

Callers 1

test_revertFunction · 0.80

Calls 1

check_errorFunction · 0.85

Tested by 1

test_revertFunction · 0.64