{"action":"closed","issue":{"url":"https://api.github.com/repos/sergeyt/parse-diff/issues/12","labels_url":"https://api.github.com/repos/sergeyt/parse-diff/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/sergeyt/parse-diff/issues/12/comments","events_url":"https://api.github.com/repos/sergeyt/parse-diff/issues/12/events","html_url":"https://github.com/sergeyt/parse-diff/issues/12","id":102297010,"number":12,"title":"No from, to when a new empty file is in the diff","user":{"login":"sungwoncho","id":8265228,"avatar_url":"https://avatars.githubusercontent.com/u/8265228?v=3","gravatar_id":"","url":"https://api.github.com/users/sungwoncho","html_url":"https://github.com/sungwoncho","followers_url":"https://api.github.com/users/sungwoncho/followers","following_url":"https://api.github.com/users/sungwoncho/following{/other_user}","gists_url":"https://api.github.com/users/sungwoncho/gists{/gist_id}","starred_url":"https://api.github.com/users/sungwoncho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sungwoncho/subscriptions","organizations_url":"https://api.github.com/users/sungwoncho/orgs","repos_url":"https://api.github.com/users/sungwoncho/repos","events_url":"https://api.github.com/users/sungwoncho/events{/privacy}","received_events_url":"https://api.github.com/users/sungwoncho/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-21T04:36:46Z","updated_at":"2015-08-26T17:33:08Z","closed_at":"2015-08-26T17:33:08Z","body":"When the diff consists of an empty, and new file, the resulting object does not have `from`, `to` properties that usually are there.\r\n\r\nTo reproduce, parse this diff:\r\n\r\n```\r\ndiff --git a/a b/a\r\nnew file mode 100644\r\nindex 0000000..e69de29\r\ndiff --git a/a.s b/a.s\r\nnew file mode 100644\r\nindex 0000000..e69de29\r\ndiff --git a/a.txt b/a.txt\r\nnew file mode 100644\r\nindex 0000000..7898192\r\n--- /dev/null\r\n+++ b/a.txt\r\n@@ -0,0 +1 @@\r\n+a\r\n```\r\n\r\nto get:\r\n\r\n```\r\n[ { chunks: [],\r\n    deletions: 0,\r\n    additions: 0,\r\n    new: true,\r\n    index: [ '0000000..e69de29' ] },\r\n  { chunks: [],\r\n    deletions: 0,\r\n    additions: 0,\r\n    new: true,\r\n    index: [ '0000000..e69de29' ] },\r\n  { chunks: [ [Object] ],\r\n    deletions: 0,\r\n    additions: 1,\r\n    new: true,\r\n    index: [ '0000000..7898192' ],\r\n    from: '/dev/null',\r\n    to: 'a.txt' }]\r\n```\r\n\r\nI think it makes sense for them to have `from: '/dev/null'` and `to: fileName`."}}