Преглед на файлове

Support refs in parse_treeish().

Ded_Secer преди 3 години
родител
ревизия
7fe42abdb8
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      dulwich/objectspec.py

+ 4 - 0
dulwich/objectspec.py

@@ -54,6 +54,10 @@ def parse_tree(repo, treeish):
       KeyError: If the object can not be found
     """
     treeish = to_bytes(treeish)
+    try:
+        treeish = parse_ref(repo, treeish)
+    except KeyError:  # treeish is commit sha
+        pass
     o = repo[treeish]
     if o.type_name == b"commit":
         return repo[o.tree]