Re: [PATCH 0/5] fix apply --intent-to-add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25/06/29 11:10AM, Lidong Yan wrote:
> I think [PATCH 2/5] actually solve the problem. [PATCH 3/5] makes 'git apply'
> consistent with 'git add', which means
>   git add —intent-to-add exist-in-index-file.c
> and
>   git apply —intent-to-add patch-contains-exist-in-index-file
> 
> will ignore intent-to-add and do nothing.

This behavior is correct and expected (even if you don't register an
intent to add) because the file is there in the worktree, so you can't
create a new file in the worktree with that name.

But the real reason for that test in create_file is that we're in a mode
that shouldn't be touching the index at all, so we shouldn't touch the
index (except in the special case where intents to add live in the
index). If there's a patch that updates existing file A, and creates new
file B, then without that test apply will touch the index for both A and
B, which is wrong. It must only touch it for B.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux