]> git.ipfire.org Git - thirdparty/git.git/commit - add-interactive.c
interactive: refactor code asking the user for interactive input
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 10 Apr 2020 11:27:50 +0000 (11:27 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Apr 2020 17:26:31 +0000 (10:26 -0700)
commit08d383f23e80e418c844952fcc4e2e635962c292
tree224078e2c20f9b24a935a4afa0c42799aaa69963
parent9fadedd637b312089337d73c3ed8447e9f0aa775
interactive: refactor code asking the user for interactive input

There are quite a few code locations (e.g. `git clean --interactive`)
where Git asks the user for an answer. In preparation for fixing a bug
shared by all of them, and also to DRY up the code, let's refactor it.

Please note that most of these callers trimmed white-space both at the
beginning and at the end of the answer, instead of trimming only the
end (as the caller in `add-patch.c` does).

Therefore, technically speaking, we change behavior in this patch. At
the same time, it can be argued that this is actually a bug fix.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-interactive.c
add-patch.c
builtin/clean.c
prompt.c
prompt.h
shell.c