From 1b021bbd85a79c9d16c1359cbc23b608685dfd9f Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 21 Dec 2020 10:35:11 +0100 Subject: gcc-changelog: new error for quoted utf8 filenames contrib/ChangeLog: * gcc-changelog/git_commit.py: Add new error for quoted filenames. * gcc-changelog/test_email.py: Test it. * gcc-changelog/test_patches.txt: Test it. --- contrib/gcc-changelog/git_commit.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'contrib/gcc-changelog/git_commit.py') diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 01f4987..f9cb8cb 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -299,6 +299,14 @@ class GitCommit: 'separately from normal commits')) return + # check for an encoded utf-8 filename + hint = 'git config --global core.quotepath false' + for modified, _ in self.info.modified_files: + if modified.startswith('"') or modified.endswith('"'): + self.errors.append(Error('Quoted UTF8 filename, please set: ' + f'"{hint}"', modified)) + return + all_are_ignored = (len(project_files) + len(ignored_files) == len(self.info.modified_files)) self.parse_lines(all_are_ignored) -- cgit v1.1