Commit 81b18d26 authored by 智勇's avatar 智勇

增加重新clone后的切分支逻辑

parent 907c7adf
......@@ -28,13 +28,16 @@ function getCode()
git checkout ./
git fetch
git pull
#如果拉代码失败,则获取现在所处分支,然后删掉现在的项目,重新clone
if [ $? -ne 0 ]; then
echo "error: Pulling is not possible because you have unmerged files"
git_branch=`git branch | grep '*' | awk '{print $2}'`
cd $project_path
rm -rf $project_folder
sh $config_server/show_info.sh $project clone代码 $desc $2
git_path=`node $config_server/get_project_config.js -name $project -attr git_path`
git clone $git_path
cd ./$project
fi
if [ -n "$git_branch" -a $git_branch != "originalBBB" ]; then
echo "git checkout -f $git_branch"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment