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

Method remove

pygit2/transaction.py:157–171  ·  view source on GitHub ↗

Remove a reference. The reference must be locked first via lock_ref(). Args: refname: Name of the reference to remove

(self, refname: str)

Source from the content-addressed store, hash-verified

155 check_error(err)
156
157 def remove(self, refname: str) -> None:
158 """Remove a reference.
159
160 The reference must be locked first via lock_ref().
161
162 Args:
163 refname: Name of the reference to remove
164 """
165 self._check_thread()
166 if self._tx is None:
167 raise ValueError('Transaction already closed')
168
169 c_refname = ffi.new('char[]', to_bytes(refname))
170 err = C.git_transaction_remove(self._tx, c_refname)
171 check_error(err)
172
173 def commit(self) -> None:
174 """Commit the transaction, applying all queued updates."""

Callers

nothing calls this directly

Calls 3

_check_threadMethod · 0.95
to_bytesFunction · 0.85
check_errorFunction · 0.85

Tested by

no test coverage detected