Set parent to HEAD
This commit is contained in:
@@ -15,6 +15,12 @@ def set_HEAD(oid):
|
||||
f.write(oid)
|
||||
|
||||
|
||||
def get_HEAD():
|
||||
if Path.is_file(f"{GIT_DIR}/HEAD"):
|
||||
with open(f"{GIT_DIR}/HEAD") as f:
|
||||
return f.read().strip()
|
||||
|
||||
|
||||
def hash_object(data, type_="blob"):
|
||||
obj = type_.encode() + b"\x00" + data
|
||||
oid = hashlib.sha1(obj).hexdigest()
|
||||
|
||||
Reference in New Issue
Block a user