Skip to content

Commit cb4420c

Browse files
committed
fix(pick): update files picker with tool='git' to not quote paths
Details: - Without extra `core.quotepath=false`, files with multibyte characters are shown differently: in `""` quotes and each byte shown separately. Resolve #2188
1 parent 6170f60 commit cb4420c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lua/mini/pick.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3406,7 +3406,9 @@ end
34063406
H.files_get_command = function(tool)
34073407
if tool == 'rg' then return { 'rg', '--files', '--color=never' } end
34083408
if tool == 'fd' then return { 'fd', '--type=f', '--color=never' } end
3409-
if tool == 'git' then return { 'git', 'ls-files', '--cached', '--others', '--exclude-standard' } end
3409+
if tool == 'git' then
3410+
return { 'git', '-c', 'core.quotepath=false', 'ls-files', '--cached', '--others', '--exclude-standard' }
3411+
end
34103412
H.error([[Wrong 'tool' for `files` builtin.]])
34113413
end
34123414

tests/test_pick.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2714,7 +2714,7 @@ T['builtin.files()']['respects `local_opts.tool`'] = function()
27142714

27152715
validate('rg', { '--files' })
27162716
validate('fd', { '--type=f' })
2717-
validate('git', { 'ls-files', '--cached', '--others' })
2717+
validate('git', { '-c', 'core.quotepath=false', 'ls-files', '--cached', '--others', '--exclude-standard' })
27182718
end
27192719

27202720
T['builtin.files()']['has fallback tool'] = function()

0 commit comments

Comments
 (0)