bugfix: selected_repository may includes more then two parts, could b… (#7114)

This commit is contained in:
answer-huang
2025-03-11 03:47:33 +08:00
committed by GitHub
parent ac680e7688
commit d6e601ea2e

View File

@@ -274,7 +274,7 @@ class Runtime(FileEditRuntimeMixin):
'github_token and selected_repository must be provided to clone a repository'
)
url = f'https://{github_token.get_secret_value()}@github.com/{selected_repository}.git'
dir_name = selected_repository.split('/')[1]
dir_name = selected_repository.split('/')[-1]
# Generate a random branch name to avoid conflicts
random_str = ''.join(
@@ -313,7 +313,7 @@ class Runtime(FileEditRuntimeMixin):
microagents_dir = workspace_root / '.openhands' / 'microagents'
repo_root = None
if selected_repository:
repo_root = workspace_root / selected_repository.split('/')[1]
repo_root = workspace_root / selected_repository.split('/')[-1]
microagents_dir = repo_root / '.openhands' / 'microagents'
self.log(
'info',