MCPcopy Index your code
hub / github.com/git/git / decode_path

Function decode_path

git-p4.py:300–315  ·  view source on GitHub ↗

Decode a given string (bytes or otherwise) using configured path encoding options.

(path)

Source from the content-addressed store, hash-verified

298
299
300def decode_path(path):
301 """Decode a given string (bytes or otherwise) using configured path
302 encoding options.
303 """
304
305 encoding = gitConfig('git-p4.pathEncoding') or 'utf_8'
306 if bytes is not str:
307 return path.decode(encoding, errors='replace') if isinstance(path, bytes) else path
308 else:
309 try:
310 path.decode('ascii')
311 except:
312 path = path.decode(encoding, errors='replace')
313 if verbose:
314 print('Path with non-ASCII characters detected. Used {} to decode: {}'.format(encoding, path))
315 return path
316
317
318def run_git_hook(cmd, param=[]):

Callers 11

p4WhereFunction · 0.85
convert_client_pathMethod · 0.85
isPathWantedMethod · 0.85
stripRepoPathMethod · 0.85
streamOneP4FileMethod · 0.85
streamOneP4DeletionMethod · 0.85
findShadowedFilesMethod · 0.85
commitMethod · 0.85

Calls 1

gitConfigFunction · 0.85

Tested by

no test coverage detected