summaryrefslogtreecommitdiff
path: root/git_remote_helpers/git
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-04 10:25:34 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-04 10:25:34 -0800
commit3e515b0d40d9ad483c4f1e076c2726d91ccc072d (patch)
treecc13ab3fb287adb12e4be67482e6907dea3dd201 /git_remote_helpers/git
parent9aea11dbc152726bbbe93630cc29b10c29d4f62e (diff)
parentae6037bc710b248946ed715fd659ef535ea78980 (diff)
Merge branch 'jk/remote-helpers-in-python-3'
Prepare remote-helper test written in Python to be run with Python3. * jk/remote-helpers-in-python-3: git_remote_helpers: remove GIT-PYTHON-VERSION upon "clean" git-remote-testpy: fix path hashing on Python 3 git-remote-testpy: call print as a function git-remote-testpy: don't do unbuffered text I/O git-remote-testpy: hash bytes explicitly svn-fe: allow svnrdump_sim.py to run with Python 3 git_remote_helpers: use 2to3 if building with Python 3 git_remote_helpers: force rebuild if python version changes git_remote_helpers: fix input when running under Python 3 git_remote_helpers: allow building with Python 3
Diffstat (limited to 'git_remote_helpers/git')
-rw-r--r--git_remote_helpers/git/importer.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/git_remote_helpers/git/importer.py b/git_remote_helpers/git/importer.py
index e28cc8f986..d3f90e1024 100644
--- a/git_remote_helpers/git/importer.py
+++ b/git_remote_helpers/git/importer.py
@@ -18,13 +18,16 @@ class GitImporter(object):
def get_refs(self, gitdir):
"""Returns a dictionary with refs.
+
+ Note that the keys in the returned dictionary are byte strings as
+ read from git.
"""
args = ["git", "--git-dir=" + gitdir, "for-each-ref", "refs/heads"]
- lines = check_output(args).strip().split('\n')
+ lines = check_output(args).strip().split('\n'.encode('ascii'))
refs = {}
for line in lines:
- value, name = line.split(' ')
- name = name.strip('commit\t')
+ value, name = line.split(' '.encode('ascii'))
+ name = name.strip('commit\t'.encode('ascii'))
refs[name] = value
return refs