summaryrefslogtreecommitdiff
path: root/t/t4211
diff options
context:
space:
mode:
authorLibravatar Carlo Marcelo Arenas Belón <carenas@gmail.com>2021-11-28 09:49:03 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-11-28 15:14:09 -0800
commitfc8a8126df822f82ab65135296b5bd569af276c1 (patch)
treeababf89d84babec44302deedcf8927ed187a0e50 /t/t4211
parentGit 2.30.2 (diff)
downloadtgif-fc8a8126df822f82ab65135296b5bd569af276c1.tar.xz
add -p: avoid use of undefined $key when ReadKey -> EOF
b5cc003253 (add -i: ignore terminal escape sequences, 2011-05-17) add an additional check to the original code to better handle keys for escape sequences, but failed to account for the possibility the first ReadKey call returned undef (ex: stdin closes) and that was being handled fine by the original code in ca6ac7f135 (add -p: prompt for single characters, 2009-02-05) Add a test for undefined and encapsulate the loop and the original print that relied on it within it. After this, the following command (in a suitable repository state) wouldn't print any error: $ git -c interactive.singleKey add -p </dev/null Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4211')
0 files changed, 0 insertions, 0 deletions