Skip to content

Feature Request: rename parsing #33

Description

@alikhamesy

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);
  });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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