filter-repo: improve invalid repository error message

Even though the repository is encoded as a bytestring, we want error
messages to be UTF-8.

Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
Elijah Newren 2021-04-01 11:57:38 -07:00
parent 7500fb7c5a
commit cf67ccd978
2 changed files with 2 additions and 2 deletions

View File

@ -1504,7 +1504,7 @@ class GitUtils(object):
count = int(p2.communicate()[0]) count = int(p2.communicate()[0])
if p1.poll() != 0: if p1.poll() != 0:
raise SystemExit(_("%s does not appear to be a valid git repository") raise SystemExit(_("%s does not appear to be a valid git repository")
% repo) % decode(repo))
return count return count
@staticmethod @staticmethod

View File

@ -160,7 +160,7 @@ test_expect_success 'other error cases' '
cd other && cd other &&
! python3 -c "import git_filter_repo as fr; fr.GitUtils.get_commit_count(b\".\", [\"HEAD\"])" 2>err && ! python3 -c "import git_filter_repo as fr; fr.GitUtils.get_commit_count(b\".\", [\"HEAD\"])" 2>err &&
test_i18ngrep ". does not appear to be a valid git repository" err test_i18ngrep "\. does not appear to be a valid git repository" err
) )
' '