mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 02:06:21 +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
|
||||
# This is much faster than using `git branch`,
|
||||
# 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/remotes/(.*)$' '$1\tRemote Branch'
|
||||
end
|
||||
|
@ -39,7 +39,7 @@ function __fish_git_unique_remote_branches
|
|||
# `git checkout frobulate` is equivalent to `git checkout -b frobulate --track alice/frobulate`.
|
||||
command git for-each-ref --format="%(refname:strip=3)" \
|
||||
--sort="refname:strip=3" \
|
||||
"refs/remotes/*/$match*" "refs/remotes/*/*/**" | \
|
||||
"refs/remotes/*/$match*" "refs/remotes/*/*/**" 2>/dev/null | \
|
||||
uniq -u
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user