The gerrit remote have to be added after repo is cloned
to make sure git review have a correct project path
for ONAP repositories on Nordix.
Change-Id: Ie5d1f1d0bf0d2b1902f87c95135084c63e7c748b
fi
git clone ssh://$1@gerrit.nordix.org:29418/$2 $3
-
scp -p -P 29418 $1@gerrit.nordix.org:hooks/commit-msg $3/.git/hooks
-
cd $3
+
+# Adding gerrit remote base on the origin URL to make sure the git review have
+# a correct project path for repositories on Nordix
+gerrit_remote=$(git remote -v | awk ' /^origin.*\(push\)/ { print $2 }')
+git remote add gerrit ${gerrit_remote}
+
git checkout master