Skip to content

not discarding "a/" and "b/" prefixes in paths when parsing git patches with no diff #43

@necipfazil

Description

@necipfazil

Given a git diff as follows (which only contains header but no diff since it is just renaming):

diff --git a/myfile2.txt b/myfile3.txt                                     
similarity index 100%                                                      
rename from myfile2.txt                                                    
rename to myfile3.txt

a/ and b/ prefixes are kept in old_path and new_path:

diff(
  header=header(index_path=None, old_path='a/myfile2.txt', old_version=None, new_path='b/myfile3.txt', new_version=None),
  changes=None,
  text='diff --git a/myfile2.txt b/myfile3.txt\nsimilarity index 100%\nrename from myfile2.txt\nrename to myfile3.txt\n'
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions