diff --git a/share/completions/git.fish b/share/completions/git.fish index ecf49c5e1..c84098861 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -47,12 +47,9 @@ function __fish_git_tags command git tag --sort=-creatordate 2>/dev/null end -function __fish_git_dir - command git rev-parse --git-dir 2>/dev/null -end - function __fish_git_heads - set -l gitdir (__fish_git_dir) + set -l gitdir (command git rev-parse --git-dir 2>/dev/null) + or return # No git dir, no need to even test. for head in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD if test -f $gitdir/$head echo $head