Implement symbolic refs idea
This commit is contained in:
parent
3770c81942
commit
7a0f86e49b
@ -20,9 +20,15 @@ def update_ref(ref, oid):
|
||||
|
||||
def get_ref(ref):
|
||||
ref_path = f"{GIT_DIR}/{ref}"
|
||||
value = None
|
||||
if Path.is_file(ref_path):
|
||||
with open(ref_path) as f:
|
||||
return f.read().strip()
|
||||
value = f.read().strip()
|
||||
|
||||
if value and value.startswith("ref:"):
|
||||
return get_ref(value.split(":", 1)[1].strip())
|
||||
|
||||
return value
|
||||
|
||||
|
||||
def iter_refs():
|
||||
|
Loading…
Reference in New Issue
Block a user