built-in add -i: re-implement `revert` in C
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 29 Nov 2019 21:11:45 +0000 (21:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 1 Dec 2019 15:30:54 +0000 (07:30 -0800)
commitc54ef5e4246f569b084db5b90bbb93c854bb0aa6
treef51698a1c30345e39107435af6ae2b3b186ef69f
parenta8c45be939d88c2d1df88daf7958da2ee5dce170
built-in add -i: re-implement `revert` in C

This is a relatively straight-forward port from the Perl version, with
the notable exception that we imitate `git reset -- <paths>` in the C
version rather than the convoluted `git ls-tree HEAD -- <paths> | git
update-index --index-info` followed by `git update-index --force-remove
-- <paths>` for the missed ones.

While at it, we fix the pretty obvious bug where the `revert` command
offers to unstage files that do not have staged changes.

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