summaryrefslogtreecommitdiff
path: root/t/t4211/expect.parallel-change-f-to-main
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2020-05-27 21:09:06 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-05-27 14:50:20 -0700
commit2c8bd8471a6abc68064dafc743362547fc730f77 (patch)
tree31442c60ddd564c9cffbfb33810ad79acaf0bfc1 /t/t4211/expect.parallel-change-f-to-main
parentci: include the built-in `git add -i` in the `linux-gcc` job (diff)
downloadtgif-2c8bd8471a6abc68064dafc743362547fc730f77.tar.xz
checkout -p: handle new files correctly
The original patch selection code was written for `git add -p`, and the fundamental unit on which it works is a hunk. We hacked around that to handle deletions back in 24ab81ae4d (add-interactive: handle deletion of empty files, 2009-10-27). But `git add -p` would never see a new file, since we only consider the set of tracked files in the index. However, since the same machinery was used for `git checkout -p` & friends, we can see new files. Handle this case specifically, adding a new prompt for it that is modeled after the `deleted file` case. This also fixes the problem where added _empty_ files could not be staged via `git checkout -p`. Reported-by: Merlin Büge <toni@bluenox07.de> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4211/expect.parallel-change-f-to-main')
0 files changed, 0 insertions, 0 deletions