id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges 10598,GitPlugin: PyGIT._get_branches fails with ValueError on commit messages with line feeds,Peter Suter,Jun Omae,"''Created as part of the [ticket:10594 move of GitPlugin]. Tickets originally reported for th:GitPlugin: th:#8639'' Quoting [ticket:8639 Carsten Klein]: > I have a commit here that includes a subject line that includes !^M characters. > This will cause get_branches to fail when trying to unpack the malformed lines resulting from splitting on linefeed boundary. > > Here is a proposed fast solution that will replace all !^M characters so that retrieving the branch information does not fail {{{#!diff --- /trunk/tracopt/versioncontrol/git/PyGIT.py +++ /trunk/tracopt/versioncontrol/git/PyGIT.py def _get_branches(self): ""returns list of (local) branches, with active (= HEAD) one being the first item"" result = [] - for e in self.repo.branch(""-v"", ""--no-abbrev"").splitlines(): + for e in self.repo.branch(""-v"", ""--no-abbrev"").replace('\r', '/CTRL-R').splitlines(): bname, bsha = e[1:].strip().split()[:2] if e.startswith('*'): result.insert(0, (bname, bsha)) else: result.append((bname, bsha)) return result }}}",defect,closed,lowest,1.0.2,plugin/git,,normal,fixed,,Ryan J Ollos,,fix `ValueError` in `Storage._get_branches()` if a branch head has carriage returns in the commit log,Extended exception handling in `trac.tests.util:rmtree`.,