diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-05-27 21:09:06 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-05-27 14:50:20 -0700 |
commit | 2c8bd8471a6abc68064dafc743362547fc730f77 (patch) | |
tree | 31442c60ddd564c9cffbfb33810ad79acaf0bfc1 /Documentation/gitworkflows.txt | |
parent | b2627cc3d4be2f8086711097f99d79a32c6a703a (diff) | |
download | git-2c8bd8471a6abc68064dafc743362547fc730f77.tar.gz |
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 'Documentation/gitworkflows.txt')
0 files changed, 0 insertions, 0 deletions