summaryrefslogtreecommitdiff
path: root/t/t9902-completion.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-03-20 18:03:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-21 02:52:11 (GMT)
commit057ab54b6646fbdabc8c953299f218081ff67456 (patch)
treef04384200663b1ef50f251c5588459bbbd6aa830 /t/t9902-completion.sh
parent402e3e1500b3bce5cee9f903f8aa691a8010e76a (diff)
downloadgit-057ab54b6646fbdabc8c953299f218081ff67456.zip
git-057ab54b6646fbdabc8c953299f218081ff67456.tar.gz
git-057ab54b6646fbdabc8c953299f218081ff67456.tar.bz2
completion: fix multiple command removals
Commit 6532f3740b ("completion: allow to customize the completable command list", 2018-05-20) tried to allow multiple space-separated entries in completion.commands. To do this, it copies each parsed token into a strbuf so that the result is NUL-terminated. However, for tokens starting with "-", it accidentally passes the original non-terminated string, meaning that only the final one worked. Switch to using the strbuf. Reported-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9902-completion.sh')
-rwxr-xr-xt/t9902-completion.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 3d1859f..43cf313 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1484,7 +1484,7 @@ test_expect_success 'git --help completion' '
test_completion "git --help core" "core-tutorial "
'
-test_expect_failure 'completion.commands removes multiple commands' '
+test_expect_success 'completion.commands removes multiple commands' '
test_config completion.commands "-cherry -mergetool" &&
git --list-cmds=list-mainporcelain,list-complete,config >out &&
! grep -E "^(cherry|mergetool)$" out