androdeb: make repository URL detection more robust

The previous logic to detect the git repository URL was prone to failure
when git version changed. Changed it to rely on git config and use the first
remote found

Signed-off-by: Erick Reyes <erickreyes@google.com>
diff --git a/androdeb b/androdeb
index 9456d60..ee898fb 100755
--- a/androdeb
+++ b/androdeb
@@ -205,12 +205,7 @@
 }
 
 function detect_repo_url() {
-	GIT_REMOTE=`cd $spath && git branch -vv | grep "\*" | sed -e "s/.*\[//" | cut -d "/" -f 1`
-	if [ -z $GIT_REMOTE ]; then
-		c_warning "Not running from a git repository, unable to determine URL"
-		return 0
-	fi
-	ADEB_REPO_URL=`cd $spath && git remote show $GIT_REMOTE | grep "Fetch URL" | sed -e "s/.*Fetch URL://" \
+	ADEB_REPO_URL=`cd $spath && git config -l | grep -m1 remote | grep url | sed -e "s/.*url=//" \
 		 -e "s/.*@//"  \
 		 -e "s/https:\/\///" \
 		 -e "s/:/\//"  \