diff options
author | Jeff King <peff@peff.net> | 2012-09-27 01:51:06 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-28 04:25:52 +0400 |
commit | bafed0dfb405b27e8b2b9680beece1dfaf5fdab2 (patch) | |
tree | d11775382dc80138070edf80d3a36c9a42d369f0 /t/t9902-completion.sh | |
parent | 49ba92b4eaca44ee4d7444b2256d60c2f32268ee (diff) |
t9902: add completion tests for "odd" filenames
We correctly handle completion items with spaces just fine,
since we pass the lists around with newline delimiters.
However, we do not handle filenames with shell
metacharacters, as "compgen -W" performs expansion on the
list we give it.
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-x | t/t9902-completion.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 2fc833ad8b..cbd0fb66f9 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -269,4 +269,23 @@ test_expect_success '<ref>: completes paths' ' EOF ' +test_expect_success 'complete tree filename with spaces' ' + echo content >"name with spaces" && + git add . && + git commit -m spaces && + test_completion_long "git show HEAD:nam" <<-\EOF + name with spaces_ + EOF +' + +test_expect_failure 'complete tree filename with metacharacters' ' + echo content >"name with \${meta}" && + git add . && + git commit -m meta && + test_completion_long "git show HEAD:nam" <<-\EOF + name with ${meta}_ + name with spaces_ + EOF +' + test_done |