{"thread":{"id":"55724","subject":"[BUG] apply -N deletes the index","startedAt":"2021-05-18T13:59:26Z","lastAt":"2021-05-18T13:59:26Z","messageCount":1,"participants":["Raymond E. Pasco"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"424874","messageId":"CBGFBF8EDCPS.LNG4VOVFVR6M@ziyou.local","threadId":"55724","inReplyTo":null,"subject":"[BUG] apply -N deletes the index","fromName":"Raymond E. Pasco","fromEmail":"ray@ameretat.dev","sentAt":"2021-05-18T13:59:20Z","receivedAt":"2021-05-18T13:59:26Z","isPatch":false,"sender":{"key":"ray@ameretat.dev","avatar":"https://avatars.githubusercontent.com/u/115765?v=4"},"body":"Expected behavior: git apply -N foo.patch applies a patch to the\nworktree, additionally adding 'new file' entries in the patch to the\nindex as intent-to-add entries.\n\nActual behavior: git apply -N foo.patch overwrites the entire index, so\nthat after the command it *only* contains the intent-to-add entries\nadded by the patch, and nothing else. (It still applies properly to the\nworktree.)\n\nI am looking at apply.c to figure out why this happens, but thought a\nreport to the list was warranted; any thoughts from someone more\nfamiliar with this machinery would be helpful.\n\nI went back in the history and this seems to have happened since the\nfeature was first added (ac997db0, Merge branch 'nd/diff-apply-ita').\n"}]}