Resolve name to oid in argparse

This commit is contained in:
2024-04-20 21:38:04 +02:00
parent 63dcbeb9e7
commit 671fa4b6b1
2 changed files with 13 additions and 5 deletions

View File

@@ -96,9 +96,11 @@ def commit(message):
return oid
def create_tag(name, oid):
data.update_ref(f"refs/tags/{name}", oid)
def checkout(oid):
commit = get_commit(oid)
read_tree(commit.tree)
@@ -126,5 +128,9 @@ def get_commit(oid):
return Commit(tree=tree, parent=parent, message=message)
def get_oid(name):
return data.get_ref(name) or name
def is_ignored(path):
return ".ugit" in path.split("/")