Skip to content

Commit cc8db44

Browse files
committed
Fix git cinnabar git2hg --batch when running with python3
1 parent 6d21541 commit cc8db44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cinnabar/cmd/convert.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ def git2hg(args):
9595
'''convert git sha1 to corresponding mercurial sha1'''
9696

9797
def do_one(arg):
98-
data = GitHgHelper.git2hg(arg.encode('ascii'))
98+
if isinstance(arg, str):
99+
arg = arg.encode('ascii')
100+
data = GitHgHelper.git2hg(arg)
99101
if data:
100102
assert data.startswith(b'changeset ')
101103
bytes_stdout.write(data[10:10 + args.abbrev])

0 commit comments

Comments
 (0)