

@classmethod
def list_from_string(cls, repo, text):
    diffs = []
    diff_header = re.compile('\n            #^diff[ ]--git\n                [ ]a/(?P<a_path>\\S+)[ ]b/(?P<b_path>\\S+)\\n\n            (?:^similarity[ ]index[ ](?P<similarity_index>\\d+)%\\n\n               ^rename[ ]from[ ](?P<rename_from>\\S+)\\n\n               ^rename[ ]to[ ](?P<rename_to>\\S+)(?:\\n|$))?\n            (?:^old[ ]mode[ ](?P<old_mode>\\d+)\\n\n               ^new[ ]mode[ ](?P<new_mode>\\d+)(?:\\n|$))?\n            (?:^new[ ]file[ ]mode[ ](?P<new_file_mode>.+)(?:\\n|$))?\n            (?:^deleted[ ]file[ ]mode[ ](?P<deleted_file_mode>.+)(?:\\n|$))?\n            (?:^index[ ](?P<a_commit>[0-9A-Fa-f]+)\n                \\.\\.(?P<b_commit>[0-9A-Fa-f]+)[ ]?(?P<b_mode>.+)?(?:\\n|$))?\n        ', (re.VERBOSE | re.MULTILINE)).match
    for diff in ('\n' + text).split('\ndiff --git')[1:]:
        header = diff_header(diff)
        (a_path, b_path, similarity_index, rename_from, rename_to, old_mode, new_mode, new_file_mode, deleted_file_mode, a_commit, b_commit, b_mode) = header.groups()
        (new_file, deleted_file) = (bool(new_file_mode), bool(deleted_file_mode))
        diffs.append(Diff(repo, a_path, b_path, a_commit, rename_to, (old_mode or deleted_file_mode), (new_mode or new_file_mode or b_mode), new_file, deleted_file, rename_from, rename_to, diff[header.end():]))
    return diffs

dataset/ETHPy150Open kergoth/git-origin/git-python/lib/git/diff.py Diff.list_from_string/VarMisuse@134/502 `b_commit`->`rename_to`