From: Mike Frysinger Date: Sat, 25 Jan 2020 09:01:03 +0000 (-0500) Subject: vcs-url: improve origin lookup X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a1826e38803eb7a2fca38210dabc2a3051ede96e;p=home.git vcs-url: improve origin lookup --- diff --git a/.bin/vcs-url b/.bin/vcs-url index 94ff2a0..8b05986 100755 --- a/.bin/vcs-url +++ b/.bin/vcs-url @@ -64,6 +64,16 @@ git_url() { local repo url local remote=$(git config remote.origin.url) + + if [[ -z ${remote} ]] ; then + # Maybe the repo doesn't use "origin". Try harder. + local branch=$(git rev-parse --abbrev-ref HEAD) + remote=$(git config "branch.${branch}.remote") + if [[ -n ${remote} ]] ; then + remote=$(git config "remote.${remote}.url") + fi + fi + case ${remote} in *://uclibc.org/*|*://git.uclibc.org/*|\ *://busybox.net/*|*://git.busybox.net/*|\