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

Method state

pygit2/repository.py:679–690  ·  view source on GitHub ↗

Determines the state of a git repository - ie, whether an operation (merge, cherry-pick, etc) is in progress. Returns a RepositoryState constant.

(self)

Source from the content-addressed store, hash-verified

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

Callers 2

test_revertFunction · 0.80

Calls 1

RepositoryStateClass · 0.85

Tested by 2

test_revertFunction · 0.64