Re: [PATCH v5 2/3] apply: make i-t-a entries never match worktree
- From
Raymond E. Pasco <ray@ameretat.dev>
- Date
- Aug 8, 2020, 15:58 UTC
- Message-ID
- <C4RQMTXM9R7C.1WK5637SFISUU@ziyou.local>
- In-Reply-To
- <d81e79a9-7d7f-22a0-9d53-06fb92b0af48@gmail.com>
On Sat Aug 8, 2020 at 11:48 AM EDT, Phillip Wood wrote:
Show 6 quoted lines
> If I've understood correctly an i-t-a entry in the index combined with > nothing in the worktree is a deletion and that is why we don't want > --index to succeed when applying a creation patch? If so an expanded > explanation in the commit message to this patch would help rather than > just saying 'by definition'. I'm still a bit confused as we don't count > it as a deletion when using --cached or applying to the worktree.
Nothing that complicated - --index requires that the index and worktree be identical, and nothing that can possibly be in a worktree is identical to an i-t-a entry.
> > --check goes through all the same code, > > The same code as --cached or --index? (I assume it's the former but > wanted to be sure)
"--cached --check" goes through the same code paths as "--cached", "--cached --index" goes through the same code paths as "--index", "--check" goes through the same code paths as [no options]. The option just makes it skip the part where it writes things out.