Fix CTRL-O when `git config branch."${branch}".remote` returning an URL

main
Junegunn Choi 2 years ago
parent 27aa7a3202
commit 183dead640
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -48,7 +48,7 @@ if [[ $# -gt 1 ]]; then
esac esac
remote=${remote:-$(git config branch."${branch}".remote || echo 'origin')} remote=${remote:-$(git config branch."${branch}".remote || echo 'origin')}
remote_url=$(git remote get-url "$remote") remote_url=$(git remote get-url "$remote" 2> /dev/null || echo "$remote")
if [[ $remote_url =~ ^git@ ]]; then if [[ $remote_url =~ ^git@ ]]; then
url=${remote_url%.git} url=${remote_url%.git}

Loading…
Cancel
Save