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

Method lock_ref

pygit2/transaction.py:74–86  ·  view source on GitHub ↗

Lock a reference in preparation for updating it. Args: refname: Name of the reference to lock (e.g., 'refs/heads/master')

(self, refname: str)

Source from the content-addressed store, hash-verified

72 )
73
74 def lock_ref(self, refname: str) -> None:
75 """Lock a reference in preparation for updating it.
76
77 Args:
78 refname: Name of the reference to lock (e.g., 'refs/heads/master')
79 """
80 self._check_thread()
81 if self._tx is None:
82 raise ValueError('Transaction already closed')
83
84 c_refname = ffi.new('char[]', to_bytes(refname))
85 err = C.git_transaction_lock_ref(self._tx, c_refname)
86 check_error(err)
87
88 def set_target(
89 self,

Callers 12

update_ref1Function · 0.80
update_ref2Function · 0.80
thread1_taskFunction · 0.80
thread2_taskFunction · 0.80
create_transactionFunction · 0.80

Calls 3

_check_threadMethod · 0.95
to_bytesFunction · 0.85
check_errorFunction · 0.85

Tested by 12

update_ref1Function · 0.64
update_ref2Function · 0.64
thread1_taskFunction · 0.64
thread2_taskFunction · 0.64
create_transactionFunction · 0.64