fix completion

This commit is contained in:
fatalerrors
2026-05-06 18:12:14 +02:00
parent 9e22f007b9
commit 9698f0e506

View File

@@ -56,6 +56,21 @@ _profile_git_complete_refs()
COMPREPLY=( $(compgen -W "$(git for-each-ref --format='%(refname:short)' refs/heads refs/remotes refs/tags 2>/dev/null)" -- "$cur") )
}
_profile_git_complete_add_paths()
{
local complete_opt="--others --modified --directory --no-empty-directory"
if declare -F __git_complete_index_file >/dev/null 2>&1; then
if [[ -n $(__git_find_on_cmdline "-u --update") ]]; then
complete_opt="--modified"
fi
__git_complete_index_file "$complete_opt"
return 0
fi
COMPREPLY=( $(compgen -f -- "${COMP_WORDS[COMP_CWORD]}") )
}
_complete_gst()
{
local cur
@@ -118,7 +133,7 @@ _complete_gacp()
return 0
fi
COMPREPLY=( $(compgen -f -- "$cur") )
_profile_git_complete_add_paths
}
_complete_greset()