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

Function strarray_to_strings

pygit2/utils.py:113–123  ·  view source on GitHub ↗

Return a list of strings from a git_strarray pointer. Free the strings contained in the git_strarry, this means it won't be usable after calling this function.

(arr)

Source from the content-addressed store, hash-verified

111
112
113def strarray_to_strings(arr) -> list[str]:
114 """
115 Return a list of strings from a git_strarray pointer.
116
117 Free the strings contained in the git_strarry, this means it won't be usable after
118 calling this function.
119 """
120 try:
121 return [ffi.string(arr.strings[i]).decode('utf-8') for i in range(arr.count)]
122 finally:
123 C.git_strarray_dispose(arr)
124
125
126class StrArray:

Callers 3

fetch_refspecsMethod · 0.85
push_refspecsMethod · 0.85
renameMethod · 0.85

Calls 1

stringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…