MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / immutable_changes_digest

Function immutable_changes_digest

tools/materialize-bench/imported_guest.py:92–100  ·  view source on GitHub ↗
(repo)

Source from the content-addressed store, hash-verified

90
91
92def immutable_changes_digest(repo):
93 value = hashlib.sha256()
94 for path in sorted((repo / '.atomic/changes').rglob('*')):
95 if path.is_file():
96 name = os.fsencode(str(path.relative_to(repo / '.atomic/changes')))
97 value.update(len(name).to_bytes(8, 'big'))
98 value.update(name)
99 value.update(bytes.fromhex(digest(path)))
100 return value.hexdigest()
101
102
103def prepare(args):

Callers 1

prepareFunction · 0.85

Calls 4

digestFunction · 0.70
is_fileMethod · 0.45
updateMethod · 0.45
to_bytesMethod · 0.45

Tested by

no test coverage detected