Skip to content

Paths undefined for empty added/removed files #24

@colinodell

Description

@colinodell

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"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions