MCPcopy Index your code
hub / github.com/danvk/webdiff / fetch

Function fetch

webdiff/githubdiff.py:80–87  ·  view source on GitHub ↗
(repo, filename, sha)

Source from the content-addressed store, hash-verified

78
79@memoize
80def fetch(repo, filename, sha):
81 if filename == '':
82 return ''
83 data = repo.get_contents(filename, sha).decoded_content
84 _, ext = os.path.splitext(filename)
85 fd, path = tempfile.mkstemp(suffix=ext)
86 open(path, 'wb').write(data)
87 return path

Callers 6

a_pathMethod · 0.85
b_pathMethod · 0.85
getOrNullFunction · 0.85
getDiffFunction · 0.85
computePerceptualDiffBoxFunction · 0.85
getThickDiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected