@@ -92,21 +92,30 @@ async def clone_repo(config: CloneConfig) -> tuple[bytes, bytes]:
9292 if commit :
9393 # Scenario 1: Clone and checkout a specific commit
9494 # Clone the repository without depth to ensure full history for checkout
95- clone_cmd = ["git" , "clone" , "--single-branch" , url , local_path ]
95+ clone_cmd = ["git" , "clone" , "--recurse-submodules" , "-- single-branch" , url , local_path ]
9696 await _run_git_command (* clone_cmd )
9797
9898 # Checkout the specific commit
9999 checkout_cmd = ["git" , "-C" , local_path , "checkout" , commit ]
100100 return await _run_git_command (* checkout_cmd )
101101
102102 if branch and branch .lower () not in ("main" , "master" ):
103-
104103 # Scenario 2: Clone a specific branch with shallow depth
105- clone_cmd = ["git" , "clone" , "--depth=1" , "--single-branch" , "--branch" , branch , url , local_path ]
104+ clone_cmd = [
105+ "git" ,
106+ "clone" ,
107+ "--recurse-submodules" ,
108+ "--depth=1" ,
109+ "--single-branch" ,
110+ "--branch" ,
111+ branch ,
112+ url ,
113+ local_path ,
114+ ]
106115 return await _run_git_command (* clone_cmd )
107116
108117 # Scenario 3: Clone the default branch with shallow depth
109- clone_cmd = ["git" , "clone" , "--depth=1" , "--single-branch" , url , local_path ]
118+ clone_cmd = ["git" , "clone" , "--recurse-submodules" , "-- depth=1" , "--single-branch" , url , local_path ]
110119 return await _run_git_command (* clone_cmd )
111120
112121
0 commit comments