Skip to content

Commit d6e601e

Browse files
authored
bugfix: selected_repository may includes more then two parts, could b… (#7114)
1 parent ac680e7 commit d6e601e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openhands/runtime/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def clone_repo(
274274
'github_token and selected_repository must be provided to clone a repository'
275275
)
276276
url = f'https://{github_token.get_secret_value()}@github.com/{selected_repository}.git'
277-
dir_name = selected_repository.split('/')[1]
277+
dir_name = selected_repository.split('/')[-1]
278278

279279
# Generate a random branch name to avoid conflicts
280280
random_str = ''.join(
@@ -313,7 +313,7 @@ def get_microagents_from_selected_repo(
313313
microagents_dir = workspace_root / '.openhands' / 'microagents'
314314
repo_root = None
315315
if selected_repository:
316-
repo_root = workspace_root / selected_repository.split('/')[1]
316+
repo_root = workspace_root / selected_repository.split('/')[-1]
317317
microagents_dir = repo_root / '.openhands' / 'microagents'
318318
self.log(
319319
'info',

0 commit comments

Comments
 (0)