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

Method head_id

pygit2/submodules.py:171–181  ·  view source on GitHub ↗

The submodule's HEAD commit id (as recorded in the superproject's current HEAD tree). Returns None if the superproject's HEAD doesn't contain the submodule.

(self)

Source from the content-addressed store, hash-verified

169
170 @property
171 def head_id(self) -> Oid | None:
172 """
173 The submodule's HEAD commit id (as recorded in the superproject's
174 current HEAD tree).
175 Returns None if the superproject's HEAD doesn't contain the submodule.
176 """
177
178 head = C.git_submodule_head_id(self._subm)
179 if head == ffi.NULL:
180 return None
181 return Oid(raw=bytes(ffi.buffer(head.id)[:]))
182
183
184class SubmoduleCollection:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected