diff --git a/lib/functions/general/git.sh b/lib/functions/general/git.sh index b6c3f16ced28..dc3df01a4ac2 100644 --- a/lib/functions/general/git.sh +++ b/lib/functions/general/git.sh @@ -57,7 +57,7 @@ function git_ensure_safe_directory() { local git_dir="$1" if [[ -e "$1/.git" ]]; then display_alert "git: Marking all directories as safe, which should include" "$git_dir" "debug" - git config --global --get safe.directory "$1" > /dev/null || regular_git config --global --add safe.directory "$1" + git -C "$1" status > /dev/null || regular_git config --global --add safe.directory "$1" fi else display_alert "git not installed" "a true wonder how you got this far without git - it will be installed for you" "warn"