Search Linux Wireless

[PATCH 4/4] compat-wireless: find the actual remote URL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don't assume the remote to be called "origin".  Instead, find the
current branch first, defaulting to "master".  Then find the
corresponding remote, defaulting to "origin".  Then find the remote URL,
defaulting to "unknown".  Reuse the remote URL for TREE_NAME.

Signed-off-by: Pavel Roskin <proski@xxxxxxx>
---
 scripts/admin-update.sh |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index af4479a..5d8068d 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -295,15 +295,20 @@ done
 DIR="$PWD"
 cd $GIT_TREE
 GIT_DESCRIBE=$(git describe)
+GIT_BRANCH=$(git branch --no-color |sed -n 's/^\* //p')
+GIT_BRANCH=${GIT_BRANCH-master}
+GIT_REMOTE=$(git config branch.${GIT_BRANCH}.remote)
+GIT_REMOTE=${GIT_REMOTE-origin}
+GIT_REMOTE_URL=$(git config remote.${GIT_REMOTE}.url)
+GIT_REMOTE_URL=${GIT_REMOTE_URL-unknown}
 echo -e "${GREEN}Updated${NORMAL} from local tree: ${BLUE}${GIT_TREE}${NORMAL}"
-echo -e "Origin remote URL: ${CYAN}$(git config remote.origin.url)${NORMAL}"
+echo -e "Origin remote URL: ${CYAN}${GIT_REMOTE_URL}${NORMAL}"
 cd $DIR
 if [ -d ./.git ]; then
 	git describe > compat-release
 
 	cd $GIT_TREE
-	TREE_NAME=$(git config remote.origin.url)
-	TREE_NAME=${TREE_NAME##*/}
+	TREE_NAME=${GIT_REMOTE_URL##*/}
 
 	echo $TREE_NAME > $DIR/git-describe
 	echo $GIT_DESCRIBE >> $DIR/git-describe
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux