summaryrefslogtreecommitdiff
path: root/tempfile.h
diff options
context:
space:
mode:
authorLibravatar Phillip Wood <phillip.wood@dunelm.org.uk>2020-08-17 13:23:08 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-08-17 11:44:42 -0700
commitce910287e727e5b534d806df725c68a8dfc4790a (patch)
treed4708f694646c2e8dd96d83bb8cce558bc4c2ad3 /tempfile.h
parentadd -p: use ALLOC_GROW_BY instead of ALLOW_GROW (diff)
downloadtgif-ce910287e727e5b534d806df725c68a8dfc4790a.tar.xz
add -p: fix checking of user input
When a file has been deleted the C version of add -p allows the user to edit a hunk even though 'e' is not in the list of allowed responses. (I think 'e' is disallowed because if the file is edited it is no longer a deletion and we're not set up to rewrite the diff header). The invalid response was allowed because the test that determines whether to display 'e' was not duplicated correctly in the code that processes the user's choice. Fix this by using flags that are set when constructing the prompt and checked when processing the user's choice rather than repeating the check itself. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tempfile.h')
0 files changed, 0 insertions, 0 deletions