]> git.99rst.org Git - git.git/commit
completion: handle unusual characters for sparse-checkout
authorLessley Dennington <redacted>
Mon, 7 Feb 2022 17:31:45 +0000 (17:31 +0000)
committerJunio C Hamano <redacted>
Tue, 8 Feb 2022 18:15:43 +0000 (10:15 -0800)
commit48803821b1712687d6e06e9d7a0e911eabecf4d1
treec27ef270183a0ee6f2cf5953c1933cdf5c5bb34c
parentc5f5c5082f813a875c213445135a24c2507021dd
completion: handle unusual characters for sparse-checkout

Update the __gitcomp_directories method to de-quote and handle unusual
characters in directory names. Although this initially involved an attempt
to re-use the logic in __git_index_files, this method removed
subdirectories (e.g. folder1/0/ became folder1/), so instead new custom
logic was placed directly in the __gitcomp_directories method.

Note there are two tests for this new functionality - one for spaces and
accents and one for backslashes and tabs. The backslashes and tabs test
uses FUNNYNAMES to avoid running on Windows. This is because:

1. Backslashes are explicitly not allowed in Windows file paths.
2. Although tabs appear to be allowed when creating a file in a Windows
bash shell, they actually are not renderable (and appear as empty boxes
in the shell).

Co-authored-by: Johannes Schindelin <redacted>
Co-authored-by: Lessley Dennington <redacted>
Helped-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Lessley Dennington <redacted>
Reviewed-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
contrib/completion/git-completion.bash
t/t9902-completion.sh
git clone https://git.99rst.org/PROJECT