@@ -20,11 +20,11 @@ def pullCode(ws_path, repo_path, base_branch, feature_branch, gitConfigList):
2020 gitUrl = genCloneUrl (repo_path , gitConfig ["git_url" ], gitConfig ["git_username" ], gitConfig ["git_token" ])
2121 print (f"pullCode start { gitUrl } { base_branch } { repo_path } { ws_path } " )
2222 # 先从feature_branch拉代码,如果失败再从base_branch拉
23- result = subprocess .run (['git' , 'clone' , '-b' , feature_branch , gitUrl , repo_path ], capture_output = True , text = True , cwd = ws_path )
23+ result = subprocess .run (['git' , 'clone' , '-b' , feature_branch , gitUrl , repo_path , '--depth' , '1' ], capture_output = True , text = True , cwd = ws_path )
2424 if result .returncode != 0 :
2525 print ("git clone feature_branch failed: " + result .stderr )
2626
27- result = subprocess .run (['git' , 'clone' , '-b' , base_branch , gitUrl , repo_path ], capture_output = True , text = True , cwd = ws_path )
27+ result = subprocess .run (['git' , 'clone' , '-b' , base_branch , gitUrl , repo_path , '--depth' , '1' ], capture_output = True , text = True , cwd = ws_path )
2828 if result .returncode != 0 :
2929 print ("git clone base_branch failed: " + result .stderr )
3030 # 克隆失败,说明目录已存在,尝试重置目录
0 commit comments