2
0
Эх сурвалжийг харах

Fix encoding on python 3.

Jelmer Vernooij 6 жил өмнө
parent
commit
dc22d56dc0
1 өөрчлөгдсөн 2 нэмэгдсэн , 0 устгасан
  1. 2 0
      dulwich/porcelain.py

+ 2 - 0
dulwich/porcelain.py

@@ -1401,6 +1401,8 @@ def get_object_by_path(repo, path, committish=None):
     with open_repo_closing(repo) as r:
         commit = parse_commit(repo, committish)
         base_tree = commit.tree
+        if not isinstance(path, bytes):
+            path = path.encode(commit.encoding or DEFAULT_ENCODING)
         (mode, sha) = tree_lookup_path(
             r.object_store.__getitem__,
             base_tree, path)