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

Method __init__

pygit2/transaction.py:54–62  ·  view source on GitHub ↗
(self, repository: BaseRepository)

Source from the content-addressed store, hash-verified

52 """
53
54 def __init__(self, repository: BaseRepository) -> None:
55 self._repository = repository
56 self._transaction = ffi.new('git_transaction **')
57 self._tx = None
58 self._thread_id = threading.get_ident()
59
60 err = C.git_transaction_new(self._transaction, repository._repo)
61 check_error(err)
62 self._tx = self._transaction[0]
63
64 def _check_thread(self) -> None:
65 """Verify transaction is being used from the same thread that created it."""

Callers

nothing calls this directly

Calls 1

check_errorFunction · 0.85

Tested by

no test coverage detected