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

Paths undefined for empty added/removed files #24

Open
colinodell opened this issue Apr 8, 2022 · 0 comments · May be fixed by #25
Open

Paths undefined for empty added/removed files #24

colinodell opened this issue Apr 8, 2022 · 0 comments · May be fixed by #25

Comments

@colinodell
Copy link

This library does not correctly parse git diffs for empty files that are added or removed. Below are sample diffs and the resulting parse() output:

Adding an empty file

diff --git a/a.txt b/a.txt
new file mode 100644
index 0000000..7898192
{
  "hunks": [],
  "oldEndingNewLine": true,
  "newEndingNewLine": true,
  "newMode": "100644",
  "oldRevision": "0000000",
  "newRevision": "7898192",
  "type": "modify"
}

Removing an empty file

diff --git a/a.txt b/a.txt
deleted file mode 100644
index 7898192..0000000
{
  "hunks": [],
  "oldEndingNewLine": true,
  "newEndingNewLine": true,
  "oldMode": "100644",
  "oldRevision": "7898192",
  "newRevision": "0000000",
  "type": "modify"
}
@colinodell colinodell linked a pull request Apr 8, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant