MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / decode_paths

Function decode_paths

scripts/ci-scope.py:38–47  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

36
37
38def decode_paths(data):
39 if not data:
40 return [] # A successful, genuinely empty diff is valid.
41 if not data.endswith(b'\0'):
42 raise ValueError('diff is not NUL terminated')
43 paths = [os.fsdecode(p) for p in data[:-1].split(b'\0')]
44 if any(not p or p.startswith('/') or any(s in ('.', '..') for s in p.split('/'))
45 for p in paths):
46 raise ValueError('invalid repository-relative diff path')
47 return paths
48
49
50def pr_paths(base, head, cwd=None):

Callers 1

pr_pathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected