]> git.ipfire.org Git - thirdparty/git.git/commit - add-patch.c
built-in add -p: handle deleted empty files
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 13 Dec 2019 08:07:55 +0000 (08:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Dec 2019 20:37:13 +0000 (12:37 -0800)
commit47dc4fd5eb4ab8fbe8ea6bb10e35d398da991cea
treec0fcdbfd88ae033016bd49dd82f23db9955028e7
parent80399aec5ab4dbcc4f3f964da4169174f1e0024e
built-in add -p: handle deleted empty files

This addresses the same problem as 24ab81ae4d (add-interactive: handle
deletion of empty files, 2009-10-27), although in a different way: we
not only stick the "deleted file" line into its own pseudo hunk, but
also the entire remainder (if any) of the same diff.

That way, we do not have to play any funny games with regards to
coalescing the diff after the user selected what (possibly pseudo-)hunks
to stage.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-patch.c