aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc-changelog/git_commit.py
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-12-11 17:18:12 +0100
committerMartin Liska <mliska@suse.cz>2022-12-11 17:22:25 +0100
commitb045179973161115c7ea029b2788f5156fc55cda (patch)
treefa6e261f5badad137e27f1589c0b4d5b4bfb44b0 /contrib/gcc-changelog/git_commit.py
parent6d799f0aed18be25a5c908499b6411ab6d06b78c (diff)
downloadgcc-b045179973161115c7ea029b2788f5156fc55cda.zip
gcc-b045179973161115c7ea029b2788f5156fc55cda.tar.gz
gcc-b045179973161115c7ea029b2788f5156fc55cda.tar.bz2
unidiff: use newline='\n' argument
In order to support CR on a line, we need to open files with newline='\n' as our line endings supposed to be of UNIX style. contrib/ChangeLog: * check_GNU_style.py: Use newline=\n. * check_GNU_style_lib.py: Simplify. * gcc-changelog/git_commit.py: Fix issues seen Rust patchset. * gcc-changelog/git_email.py: Use newline argument. * gcc-changelog/test_email.py: New test. * gcc-changelog/test_patches.txt: New test. * mklog.py: Use newline argument.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
-rwxr-xr-xcontrib/gcc-changelog/git_commit.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index aae3416..d90e6c1 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -718,11 +718,12 @@ class GitCommit:
if not prs:
# if all ChangeLog entries have identical PRs
# then use them
- prs = self.changelog_entries[0].prs
- for entry in self.changelog_entries:
- if entry.prs != prs:
- prs = []
- break
+ if self.changelog_entries:
+ prs = self.changelog_entries[0].prs
+ for entry in self.changelog_entries:
+ if entry.prs != prs:
+ prs = []
+ break
entry = ChangeLogEntry(changelog_location,
self.top_level_authors,
prs)