completions/git: fix remotes missing in e.g. git fetch

Update the regex to allow remote names which are allowed in git, like
`foo-bar`, `foo.bar` or `😜`. Do not try to artificially limit the
allowed remote names through the regex.

Closes #11941
This commit is contained in:
Luca Weiss
2025-10-13 14:30:26 +02:00
committed by Johannes Altmanninger
parent 165e0d0ed5
commit 63cda65815

View File

@@ -109,7 +109,7 @@ end
function __fish_git_remotes
# Example of output parsed:
# "remote.upstream.url git@github.com:fish-shell/fish-shell.git" -> "upstream\tgit@github.com:fish-shell/fish-shell.git"
__fish_git config --get-regexp 'remote\.[a-z]+\.url' | string replace -rf 'remote\.(.*)\.url (.*)' '$1\t$2'
__fish_git config --get-regexp '^remote\.\S+\.url$' | string replace -rf '^remote\.(\S+)\.url (.*)' '$1\t$2'
end
set -g __fish_git_recent_commits_arg