envsetup: Fix lineageremote for AOSP projects

* lineageremote was not working properly for pure AOSP projects
  because there is no github remote.
* Read and convert AOSP remote name if there is no github remote

Change-Id: I629f0a8ae3be09d539e18d63a9738c32fb24496c
gugelfrei
Michael Bestas 7 years ago
parent 9f3c85ae11
commit af3532bef5

@ -267,12 +267,17 @@ function lineageremote()
fi
git remote rm lineage 2> /dev/null
GERRIT_REMOTE=$(git config --get remote.github.projectname)
if [ -z "$GERRIT_REMOTE" ]
then
GERRIT_REMOTE=$(git config --get remote.aosp.projectname | sed s#platform/#android/#g | sed s#/#_#g)
PFX="LineageOS/"
fi
LINEAGE_USER=$(git config --get review.review.lineageos.org.username)
if [ -z "$LINEAGE_USER" ]
then
git remote add lineage ssh://review.lineageos.org:29418/$GERRIT_REMOTE
git remote add lineage ssh://review.lineageos.org:29418/$PFX$GERRIT_REMOTE
else
git remote add lineage ssh://$LINEAGE_USER@review.lineageos.org:29418/$GERRIT_REMOTE
git remote add lineage ssh://$LINEAGE_USER@review.lineageos.org:29418/$PFX$GERRIT_REMOTE
fi
echo "Remote 'lineage' created"
}

Loading…
Cancel
Save