Resolve name to oid in argparse
This commit is contained in:
@@ -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("/")
|
||||
|
||||
Reference in New Issue
Block a user