From a91c41871a32a398e8c25c63b9d728a8addd70a8 Mon Sep 17 00:00:00 2001 From: fatalerrors Date: Wed, 6 May 2026 18:20:30 +0200 Subject: [PATCH] fix completion --- profile.d/bash-completion/git-completion.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/profile.d/bash-completion/git-completion.sh b/profile.d/bash-completion/git-completion.sh index be3972b..f2beb8a 100644 --- a/profile.d/bash-completion/git-completion.sh +++ b/profile.d/bash-completion/git-completion.sh @@ -58,9 +58,26 @@ _profile_git_complete_refs() _profile_git_complete_add_paths() { + # shellcheck disable=SC2034 # Used indirectly by git-completion helpers via dynamic scope. + local cur words cword prev local complete_opt="--others --modified --directory --no-empty-directory" if declare -F __git_complete_index_file >/dev/null 2>&1; then + if declare -F _get_comp_words_by_ref >/dev/null 2>&1; then + _get_comp_words_by_ref -n =: cur words cword prev + else + cur="${COMP_WORDS[COMP_CWORD]}" + if (( COMP_CWORD > 0 )); then + prev="${COMP_WORDS[COMP_CWORD-1]}" + else + prev="" + fi + # shellcheck disable=SC2034 # Used indirectly by git-completion helpers via dynamic scope. + cword="$COMP_CWORD" + # shellcheck disable=SC2034 # Used indirectly by git-completion helpers via dynamic scope. + words=("${COMP_WORDS[@]}") + fi + if [[ -n $(__git_find_on_cmdline "-u --update") ]]; then complete_opt="--modified" fi