diff options
author | Chirayu Desai <chirayudesai1@gmail.com> | 2014-12-16 18:22:55 +0530 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-06 17:52:24 -0700 |
commit | f2f15f106b7673c9e8a8352a1dbf24fcb47b4d8a (patch) | |
tree | 229688d36f09ea8c310956aada54bc94f36387db /envsetup.sh | |
parent | 86b1255cb86aa8a06c5d4d1acd14b24195f0f08b (diff) | |
download | build-f2f15f106b7673c9e8a8352a1dbf24fcb47b4d8a.zip build-f2f15f106b7673c9e8a8352a1dbf24fcb47b4d8a.tar.gz build-f2f15f106b7673c9e8a8352a1dbf24fcb47b4d8a.tar.bz2 |
Improve cmremote
Change-Id: I7e1f87ed92cddcf8df3ea4fd701f56a9ef806add
Diffstat (limited to 'envsetup.sh')
-rw-r--r-- | envsetup.sh | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/envsetup.sh b/envsetup.sh index 0cda8cb..848acf0 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1555,21 +1555,13 @@ function godir () { function cmremote() { git remote rm cmremote 2> /dev/null - if [ ! -d .git ] - then - echo .git directory not found. Please run this from the root directory of the Android repository you wish to set up. - fi - GERRIT_REMOTE=$(cat .git/config | grep git://github.com | awk '{ print $NF }' | sed s#git://github.com/##g) + GERRIT_REMOTE=$(git config --get remote.github.projectname) if [ -z "$GERRIT_REMOTE" ] then - GERRIT_REMOTE=$(cat .git/config | grep http://github.com | awk '{ print $NF }' | sed s#http://github.com/##g) - if [ -z "$GERRIT_REMOTE" ] - then - echo Unable to set up the git remote, are you in the root of the repo? - return 0 - fi + echo Unable to set up the git remote, are you under a git repo? + return 0 fi - CMUSER=`git config --get review.review.cyanogenmod.org.username` + CMUSER=$(git config --get review.review.cyanogenmod.org.username) if [ -z "$CMUSER" ] then git remote add cmremote ssh://review.cyanogenmod.org:29418/$GERRIT_REMOTE |