Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug report; git tab-completion on macOS within paths containing unicode characters



On Sat, Apr 27, 2024 at 12:14 PM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> I'm uncertain that this is zsh's fault.  "git ls-files" is returning
> that the directory is not a git repository, at least when I try to
> reproduce.

See if this helps -- I'm not sure this is the only (or even best)
place to apply a change, but I'm curious whether it improves your
results.

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 7370aaead..47c386106 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -7526,7 +7526,7 @@ __git_files () {
   # TODO: --directory should probably be added to $opts when --others is given.

   local pref=${(Q)${~PREFIX}}
-  [[ $pref[1] == '/' ]] || pref=$gittoplevel$gitprefix$pref
+  [[ $pref[1] == '/' ]] || pref=${(qqqq)gittoplevel}$gitprefix$pref

   # First allow ls-files to pattern-match in case of remote repository. Use the
   # icase pathspec magic word to ensure that we support case-insensitive path




Messages sorted by: Reverse Date, Date, Thread, Author