mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-02 18:42:11 +08:00
completions: [git] Silence various errors outside repo
This commit is contained in:
parent
c79db8ecf7
commit
b39651f1ad
@ -27,7 +27,7 @@ end
|
|||||||
function __fish_git_branches
|
function __fish_git_branches
|
||||||
# This is much faster than using `git branch`,
|
# This is much faster than using `git branch`,
|
||||||
# and avoids having to deal with localized "detached HEAD" messages.
|
# and avoids having to deal with localized "detached HEAD" messages.
|
||||||
command git for-each-ref --format='%(refname)' refs/heads/ refs/remotes/ \
|
command git for-each-ref --format='%(refname)' refs/heads/ refs/remotes/ 2>/dev/null \
|
||||||
| string replace -r '^refs/heads/(.*)$' '$1\tLocal Branch' \
|
| string replace -r '^refs/heads/(.*)$' '$1\tLocal Branch' \
|
||||||
| string replace -r '^refs/remotes/(.*)$' '$1\tRemote Branch'
|
| string replace -r '^refs/remotes/(.*)$' '$1\tRemote Branch'
|
||||||
end
|
end
|
||||||
@ -39,7 +39,7 @@ function __fish_git_unique_remote_branches
|
|||||||
# `git checkout frobulate` is equivalent to `git checkout -b frobulate --track alice/frobulate`.
|
# `git checkout frobulate` is equivalent to `git checkout -b frobulate --track alice/frobulate`.
|
||||||
command git for-each-ref --format="%(refname:strip=3)" \
|
command git for-each-ref --format="%(refname:strip=3)" \
|
||||||
--sort="refname:strip=3" \
|
--sort="refname:strip=3" \
|
||||||
"refs/remotes/*/$match*" "refs/remotes/*/*/**" | \
|
"refs/remotes/*/$match*" "refs/remotes/*/*/**" 2>/dev/null | \
|
||||||
uniq -u
|
uniq -u
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user