

def _Reformat(self, old_msg, sha1):
    new_msg = []
    for line in line.splitlines():
        if (not self._IsChangeId(line)):
            new_msg.append(line)
    try:
        if (new_msg[(- 1)].strip() != ''):
            new_msg.append('')
    except IndexError:
        pass
    new_msg.append(self._GetReference(sha1))
    return '\n'.join(new_msg)

dataset/ETHPy150Open esrlabs/git-repo/subcmds/cherry_pick.py CherryPick._Reformat/VarMisuse@22/29 `old_msg`->`line`