X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fcommon%2Fgit_functions;h=e5b79845507861a3f0060bd28d80d1928b503b51;hb=32762293b65637677d4e1236e06bf1a2df0eb930;hp=7856623b7c0e3516478df03b6fe813a1bd56efee;hpb=3ba0cdc505055c2acd6efbc1c1dfd495437221c7;p=osm%2Fdevops.git diff --git a/jenkins/common/git_functions b/jenkins/common/git_functions index 7856623b..e5b79845 100644 --- a/jenkins/common/git_functions +++ b/jenkins/common/git_functions @@ -2,8 +2,7 @@ GIT() { - - CMD git "$@" + CMD git "$@" } @@ -13,14 +12,14 @@ OSM_git_checkout() { if [ -d $OSM_MDG ]; then INFO "reusing existing workspace" cd $OSM_MDG - GIT pull --all + GIT fetch --all --tags #git checkout master #to make sure that we are in the right branch before pulling the code #git pull else INFO "cloning MDG $OSM_MDG from $OSM_GIT_URL/$OSM_MDG" GIT clone $OSM_GIT_URL/$OSM_MDG cd $OSM_MDG - for remote in `git branch -r`; do GIT branch --track ${remote#origin/} $remote; done + for remote in `git branch -r |grep -v /HEAD`; do GIT branch --track ${remote#origin/} $remote; done fi if [ $# -gt 0 ]; then @@ -38,3 +37,4 @@ OSM_git_checkout() { fi } +