From cf67ccd978d06766490323701db7cefc68eea486 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Thu, 1 Apr 2021 11:57:38 -0700 Subject: [PATCH] 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 --- git-filter-repo | 2 +- t/t9391-filter-repo-lib-usage.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/git-filter-repo b/git-filter-repo index ae03111..3a41d95 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -1504,7 +1504,7 @@ class GitUtils(object): count = int(p2.communicate()[0]) if p1.poll() != 0: raise SystemExit(_("%s does not appear to be a valid git repository") - % repo) + % decode(repo)) return count @staticmethod diff --git a/t/t9391-filter-repo-lib-usage.sh b/t/t9391-filter-repo-lib-usage.sh index 761f43a..a79d768 100755 --- a/t/t9391-filter-repo-lib-usage.sh +++ b/t/t9391-filter-repo-lib-usage.sh @@ -160,7 +160,7 @@ test_expect_success 'other error cases' ' cd other && ! 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 ) '