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

Method get_multivar

pygit2/config.py:182–197  ·  view source on GitHub ↗

Get each value of a multivar ''name'' as a list of strings. The optional ''regex'' parameter is expected to be a regular expression to filter the variables we're interested in.

(
        self, name: str | bytes, regex: str | None = None
    )

Source from the content-addressed store, hash-verified

180 return ConfigIterator(self, citer[0])
181
182 def get_multivar(
183 self, name: str | bytes, regex: str | None = None
184 ) -> ConfigMultivarIterator:
185 """Get each value of a multivar ''name'' as a list of strings.
186
187 The optional ''regex'' parameter is expected to be a regular expression
188 to filter the variables we're interested in.
189 """
190 name = str_to_bytes(name, 'name')
191 regex_bytes = to_bytes(regex or None)
192
193 citer = ffi.new('git_config_iterator **')
194 err = C.git_config_multivar_iterator_new(citer, self._config, name, regex_bytes)
195 check_error(err)
196
197 return ConfigMultivarIterator(self, citer[0])
198
199 def set_multivar(
200 self, name: str | bytes, regex: str | bytes, value: str | bytes

Callers 1

test_multivarFunction · 0.95

Calls 4

str_to_bytesFunction · 0.85
to_bytesFunction · 0.85
check_errorFunction · 0.85

Tested by 1

test_multivarFunction · 0.76