diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2018-05-18 16:17:51 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-21 09:38:50 +0900 |
commit | 7d314073488ae81b8f5cdecb4d00a78529fa7dc3 (patch) | |
tree | 9cc5f1fef755f82d7320710bbce47f717c04adac /contrib/completion/git-completion.zsh | |
parent | completion: don't return with error from __gitcomp_file_direct() (diff) | |
download | tgif-7d314073488ae81b8f5cdecb4d00a78529fa7dc3.tar.xz |
t9902-completion: exercise __git_complete_index_file() directly
The tests added in 2f271cd9cf (t9902-completion: add tests
demonstrating issues with quoted pathnames, 2018-05-08) and in
2ab6eab4fe (completion: improve handling quoted paths in 'git
ls-files's output, 2018-03-28) have a few shortcomings:
- All these tests use the 'test_completion' helper function, thus
they are exercising the whole completion machinery, although they
are only interested in how git-aware path completion, specifically
the __git_complete_index_file() function deals with unusual
characters in pathnames and on the command line.
- These tests can't satisfactorily test the case of pathnames
containing spaces, because 'test_completion' gets the words on the
command line as a single argument and it uses space as word
separator.
- Some of the tests are protected by different FUNNYNAMES_* prereqs
depending on whether they put backslashes and double quotes or
separator characters (FS, GS, RS, US) in pathnames, although a
filesystem not allowing one likely doesn't allow the others
either.
- One of the tests operates on paths containing '|' and '&'
characters without being protected by a FUNNYNAMES prereq, but
some filesystems (notably on Windows) don't allow these characters
in pathnames, either.
Replace these tests with basically equivalent, more focused tests that
call __git_complete_index_file() directly. Since this function only
looks at the current word to be completed, i.e. the $cur variable, we
can easily include pathnames containing spaces in the tests, so use
such pathnames instead of pathnames containing '|' and '&'. Finally,
use only a single FUNNYNAMES prereq for all kinds of special
characters.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion/git-completion.zsh')
0 files changed, 0 insertions, 0 deletions