mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 08:40:38 +08:00
[completions/git] Skip bare repositories
Otherwise this would print an unsightly error.
This commit is contained in:
parent
6c1ea03e9c
commit
3b3361685a
@ -85,9 +85,14 @@ function __fish_git_files
|
||||
# to get _all_ kinds of staged files.
|
||||
|
||||
# Save the repo root to remove it from the path later.
|
||||
set -l root (command git rev-parse --show-toplevel 2>/dev/null)
|
||||
set -l root (command git rev-parse --show-toplevel --is-bare-repository 2>/dev/null)
|
||||
or return
|
||||
|
||||
# Skip bare repositories.
|
||||
test "$root[2]" = "true"
|
||||
and return
|
||||
or set -e root[2]
|
||||
|
||||
# Cache the translated descriptions so we don't have to get it
|
||||
# once per file.
|
||||
contains -- unmerged $argv; and set -l unmerged
|
||||
|
Loading…
x
Reference in New Issue
Block a user