File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ class SandboxRunner:
2828 codebase : CodebaseType
2929 executor : SandboxExecutor
3030
31- def __init__ (self , repo_config : RepoConfig ) -> None :
31+ def __init__ (self , repo_config : RepoConfig , op : RepoOperator | None = None ) -> None :
3232 self .repo = repo_config
33- self .op = RepoOperator (repo_config = self .repo , setup_option = SetupOption .PULL_OR_CLONE , bot_commit = True )
33+ self .op = op or RepoOperator (repo_config = self .repo , setup_option = SetupOption .PULL_OR_CLONE , bot_commit = True )
3434 self .commit = self .op .git_cli .head .commit
3535
3636 async def warmup (self ) -> None :
Original file line number Diff line number Diff line change 44from fastapi import FastAPI
55
66from codegen .git .configs .constants import CODEGEN_BOT_EMAIL , CODEGEN_BOT_NAME
7+ from codegen .git .repo_operator .repo_operator import RepoOperator
8+ from codegen .git .schemas .enums import SetupOption
79from codegen .git .schemas .repo_config import RepoConfig
810from codegen .runner .enums .warmup_state import WarmupState
911from codegen .runner .models .apis import (
@@ -38,8 +40,9 @@ async def lifespan(server: FastAPI):
3840 server_info = ServerInfo (repo_name = repo_config .full_name or repo_config .name )
3941
4042 # Set the bot email and username
43+ op = RepoOperator (repo_config = repo_config , setup_option = SetupOption .SKIP , bot_commit = True )
44+ runner = SandboxRunner (repo_config = repo_config , op = op )
4145 logger .info (f"Configuring git user config to { CODEGEN_BOT_EMAIL } and { CODEGEN_BOT_NAME } " )
42- runner = SandboxRunner (repo_config = repo_config )
4346 runner .op .git_cli .git .config ("user.email" , CODEGEN_BOT_EMAIL )
4447 runner .op .git_cli .git .config ("user.name" , CODEGEN_BOT_NAME )
4548
You can’t perform that action at this time.
0 commit comments