From 700eeb77859da6ace1c85b987cb50d8854b9c871 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 2 Jan 2023 12:23:50 -0800 Subject: [PATCH] fish_git_prompt: only do macOS workarounds for /usr/bin/git On macOS, fish_git_prompt was failing to correctly handle the case where another git was installed, e.g. /usr/local/bin/git from Homebrew. Disable the workarounds in that case. --- share/functions/fish_git_prompt.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/fish_git_prompt.fish b/share/functions/fish_git_prompt.fish index d129f02be..64ff5f8e0 100644 --- a/share/functions/fish_git_prompt.fish +++ b/share/functions/fish_git_prompt.fish @@ -170,8 +170,8 @@ end # Decide if git is safe to run. # On Darwin, git is pre-installed as a stub, which will pop a dialog if you run it. -if string match -q Darwin -- "$(uname)" && type -q xcode-select && type -q xcrun - if string match -q /usr/bin/git -- "$(command -s git)" && not xcode-select --print-path &>/dev/null +if string match -q Darwin -- "$(uname)" && string match -q /usr/bin/git -- "$(command -s git)" && type -q xcode-select && type -q xcrun + if not xcode-select --print-path &>/dev/null # Only the stub git is installed. # Do not try to run it. function __fish_git_prompt_ready