diff -r db2bc9e667a1 -r 416ecdaa12df mercurial/patch.py --- a/mercurial/patch.py Tue Dec 29 23:15:26 2020 +0100 +++ b/mercurial/patch.py Mon Jan 11 17:46:55 2021 -0800 @@ -393,7 +393,7 @@ gp = None gitpatches = [] for line in lr: - line = line.rstrip(b' \r\n') + line = line.rstrip(b'\r\n') if line.startswith(b'diff --git a/'): m = gitre.match(line) if m: @@ -2073,7 +2073,7 @@ yield b'file', (afile, bfile, h, gp and gp.copy() or None) yield b'hunk', h elif x.startswith(b'diff --git a/'): - m = gitre.match(x.rstrip(b' \r\n')) + m = gitre.match(x.rstrip(b'\r\n')) if not m: continue if gitpatches is None: