Print hashed objects

This commit is contained in:
2024-02-14 20:24:33 +01:00
parent 9634544d68
commit a010615cf2
2 changed files with 17 additions and 1 deletions

View File

@@ -15,3 +15,8 @@ def hash_object(data):
with open(f"{GIT_DIR}/objects/{oid}", "wb") as out:
out.write(data)
return oid
def get_object(oid):
with open(f"{GIT_DIR}/objects/{oid}", "rb") as f:
return f.read()