This patch series fixes the -N/--intent-to-add flag for git apply, which has not worked properly since its introduction in Git 2.19. In particular, the index is properly initialized, and not touched except to add the requested intents to add. Loosely based on the patch from Johannes Altmanninger, message-id <20211106114202.3486969-1-aclopte@xxxxxxxxx>, but that patch turned out to be incorrect. Raymond E. Pasco (5): apply: error on --intent-to-add outside gitdir apply: read in the index in --intent-to-add mode apply: only write intents to add for new files t4140: test apply --intent-to-add interactions apply docs: clarify wording for --intent-to-add Documentation/git-apply.adoc | 8 ++++---- apply.c | 12 ++++++++---- t/t4140-apply-ita.sh | 31 ++++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 9 deletions(-) -- 2.49.0.1106.gc0efa3ba58