From 58bfcd5a029f39a18f07ec2b35c809138a904e23 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Fri, 29 Aug 2025 15:23:55 +0200 Subject: [PATCH] Fixed lazyloading of git completion --- .functions/dotfiles.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.functions/dotfiles.sh b/.functions/dotfiles.sh index e22eb40..dc3d5e8 100644 --- a/.functions/dotfiles.sh +++ b/.functions/dotfiles.sh @@ -30,4 +30,13 @@ status_dotfiles(){ esac } -[[ $(type -t __git_complete) == function ]] && __git_complete dotf __git_main +# Load git completion explicitly +if command -v git >/dev/null 2>&1; then + # Source completion script (adjust path for your system) + if [ -f /usr/share/bash-completion/completions/git ]; then + # shellcheck disable=1091 + source /usr/share/bash-completion/completions/git + fi + # Now __git_complete should exist + [[ $(type -t __git_complete) == "function" ]] && __git_complete dotf __git_main +fi