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

Method _from_c

pygit2/index.py:418–427  ·  view source on GitHub ↗
(cls, centry)

Source from the content-addressed store, hash-verified

416
417 @classmethod
418 def _from_c(cls, centry):
419 if centry == ffi.NULL:
420 return None
421
422 automergeable = centry.automergeable != 0
423 path = to_str(ffi.string(centry.path)) if centry.path else None
424 mode = FileMode(centry.mode)
425 contents = ffi.string(centry.ptr, centry.len).decode('utf-8')
426
427 return MergeFileResult(automergeable, path, mode, contents)
428
429
430class IndexEntry:

Callers

nothing calls this directly

Calls 4

to_strFunction · 0.85
FileModeClass · 0.85
MergeFileResultClass · 0.85
stringMethod · 0.80

Tested by

no test coverage detected