Submitter | phabricator |
---|---|
Date | March 25, 2022, 4:55 p.m. |
Message ID | <differential-rev-PHID-DREV-vy5vfy26asstk73siob6-req@mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/50758/ |
State | New |
Headers | show |
Comments
Patch
diff --git a/mercurial/utils/stringutil.py b/mercurial/utils/stringutil.py --- a/mercurial/utils/stringutil.py +++ b/mercurial/utils/stringutil.py @@ -687,6 +687,10 @@ def firstline(text): """Return the first line of the input""" + # Try to avoid running splitlines() on the whole string + i = text.find(b'\n') + if i != -1: + text = text[:i] try: return text.splitlines()[0] except IndexError: