Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pygit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, repo_directory, new_repo=False):
not os.access(self.repo_directory, os.R_OK) or \
not os.access(self.repo_directory, os.W_OK) or \
not subprocess.check_output(['git', 'rev-parse', '--git-dir'],
cwd=self.repo_directory).decode('ascii').split("\n")[0]:
cwd=self.repo_directory).decode('utf-8').split("\n")[0]:
raise InvalidRepoDirectory("Invalid git repo directory: '{}'.\n"
"repo_directory must be a root repo directory "
"of git project and you must have r/w permissions.".format(self.repo_directory))
Expand Down Expand Up @@ -67,12 +67,12 @@ def _git(self, arg_string):
:returns: The stdout of the requested git command split by '\n' in the form of a list
"""
arguments = ["git"] + arg_string.split()
return subprocess.check_output(arguments, cwd=self.repo_directory).decode('ascii').split("\n")
return subprocess.check_output(arguments, cwd=self.repo_directory).decode('utf-8').split("\n")

def checkout_tag(self, tag_name):
self._git('fetch -p')
git_output = subprocess.check_output(["git", "ls-remote", "--tags"],
cwd=self.repo_directory).decode('ascii').split()
cwd=self.repo_directory).decode('utf-8').split()
remote_tags = [x.replace('refs/tags/', '') for x in git_output if 'refs/tags/' in x]
if tag_name not in remote_tags:
raise Exception("No version tag exists in the current repo named: '{}'. ".format(tag_name))
Expand Down