From a1826e38803eb7a2fca38210dabc2a3051ede96e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 25 Jan 2020 04:01:03 -0500 Subject: [PATCH] vcs-url: improve origin lookup --- .bin/vcs-url | 10 ++++++++++ 1 file changed, 10 insertions(+) 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/*|\ -- 2.39.5