completion/hub: use _command_exists

This commit is contained in:
John D Pell
2021-09-19 21:30:35 -07:00
parent 699720fe8b
commit 8e9438d715

View File

@@ -23,12 +23,12 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# If there is no git tab completion, but we have the _completion loader try to load it
if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; then
if ! _is_function _git && _is_function _completion_loader; then
_completion_loader git
fi
# Check that git tab completion is available and we haven't already set up completion
if declare -F _git > /dev/null && ! declare -F __git_list_all_commands_without_hub > /dev/null; then
if _is_function _git && ! _is_function __git_list_all_commands_without_hub; then
# Duplicate and rename the 'list_all_commands' function
eval "$(declare -f __git_list_all_commands | \
sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"