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)
| 111 | |
| 112 | |
| 113 | def 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 | |
| 126 | class StrArray: |
no test coverage detected
searching dependent graphs…