Skip to content

Commit c390e22

Browse files
committed
Fix the Repo commit and tree methods to work with unicode revs.
Signed-off-by: David Black <dblack@atlassian.com>
1 parent e8987f2 commit c390e22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎git/repo/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def commit(self, rev=None):
376376
if rev is None:
377377
return self.head.commit
378378
else:
379-
return self.rev_parse(str(rev)+"^0")
379+
return self.rev_parse(unicode(rev)+"^0")
380380

381381
def iter_trees(self, *args, **kwargs):
382382
""":return: Iterator yielding Tree objects
@@ -399,7 +399,7 @@ def tree(self, rev=None):
399399
if rev is None:
400400
return self.head.commit.tree
401401
else:
402-
return self.rev_parse(str(rev)+"^{tree}")
402+
return self.rev_parse(unicode(rev)+"^{tree}")
403403

404404
def iter_commits(self, rev=None, paths='', **kwargs):
405405
"""A list of Commit objects representing the history of a given ref/commit

0 commit comments

Comments
 (0)