Determines the state of a git repository - ie, whether an operation (merge, cherry-pick, etc) is in progress. Returns a RepositoryState constant.
(self)
| 677 | raise ValueError('Only blobs and treeish can be diffed') |
| 678 | |
| 679 | def state(self) -> RepositoryState: |
| 680 | """Determines the state of a git repository - ie, whether an operation |
| 681 | (merge, cherry-pick, etc) is in progress. |
| 682 | |
| 683 | Returns a RepositoryState constant. |
| 684 | """ |
| 685 | cstate: int = C.git_repository_state(self._repo) |
| 686 | try: |
| 687 | return RepositoryState(cstate) |
| 688 | except ValueError: |
| 689 | # Some value not in the IntEnum - newer libgit2 version? |
| 690 | return cstate # type: ignore[return-value] |
| 691 | |
| 692 | def state_cleanup(self) -> None: |
| 693 | """Remove all the metadata associated with an ongoing command like |