From: Oleg Broytman Date: Wed, 20 Aug 2025 18:44:20 +0000 (+0300) Subject: Feat(.bash_completion.d/git-funcs): Use `git remote get-url` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=b0fc5f5f19e8a1ff46b4686a1354f1ecc338a80b;p=dotfiles.git Feat(.bash_completion.d/git-funcs): Use `git remote get-url` Use `git remote get-url $remote` instead of `git config --get remote.$remote.url`. --- diff --git a/.bash_completion.d/git-funcs b/.bash_completion.d/git-funcs index e41a138..4343504 100644 --- a/.bash_completion.d/git-funcs +++ b/.bash_completion.d/git-funcs @@ -13,7 +13,7 @@ if test -x /usr/bin/git >/dev/null 2>&1; then remote="$1" fi - if [ -n "$remote" ] && git config --get remote.$remote.url | + if [ -n "$remote" ] && git remote get-url $remote | grep -q '^\(file:/\|/\|\.\./\)'; then # (file:/ or / or ../ at the beginning) cdgitpath remote.$remote.url return @@ -88,7 +88,7 @@ if test -x /usr/bin/git >/dev/null 2>&1; then declare -ag GIT_REMOTES=() local remote for remote in `git remote`; do - if git config --get remote.$remote.url | grep -q "$1"; then + if git remote get-url $remote | grep -q "$1"; then GIT_REMOTES+=($remote) fi done