Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: rename parsing #33

Open
alikhamesy opened this issue Mar 12, 2021 · 1 comment
Open

Feature Request: rename parsing #33

alikhamesy opened this issue Mar 12, 2021 · 1 comment

Comments

@alikhamesy
Copy link
Contributor

Hey so I was wondering if I can add rename parsing to the tool?

I was thinking we can read rename ... lines and set a boolean files.renamed to true. Willing to make the PR.

Perhaps also a field for the similarity index?

Something along the lines of adding this test:

  it("should parse rename diff", function () {
    const diff = `\
diff --git a/test.txt b/text2.txt
similarity index 100%
rename from test.txt
rename to text2.txt
`;
    const files = parse(diff);
    expect(files.length).toBe(1);
    const [file] = files;
    expect(file.from).toBe("test.txt");
    expect(file.to).toBe("test2.txt");
    expect(file.chunks.length).toBe(0);
    expect(file.renamed).toBe(true);
  });

@sergeyt
Copy link
Owner

sergeyt commented Mar 12, 2021

@alikhamesy all sounds good, please go ahead 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants