From 40b54b42c3275cf07629e1966ed2d61ac5e297e7 Mon Sep 17 00:00:00 2001 From: zhanglei Date: Thu, 12 Sep 2024 16:22:42 +0800 Subject: [PATCH] update: git.py --- metagpt/tools/libs/git.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/metagpt/tools/libs/git.py b/metagpt/tools/libs/git.py index dab2f820f..0f68418eb 100644 --- a/metagpt/tools/libs/git.py +++ b/metagpt/tools/libs/git.py @@ -64,11 +64,8 @@ async def git_create_pull( Returns: PullRequest: The created pull request. """ - - from metagpt.tools.libs import get_env from metagpt.utils.git_repository import GitRepository - access_token = await get_env(key="access_token", app_name=app_name) git_credentials_path = Path.home() / ".git-credentials" with open(git_credentials_path, "r", encoding="utf-8") as f: lines = f.readlines() @@ -78,7 +75,7 @@ async def git_create_pull( if not line: continue parsed_url = urllib.parse.urlparse(line) - if parsed_url.hostname == app_name: + if app_name in parsed_url.hostname: colon_index = parsed_url.netloc.find(":") at_index = parsed_url.netloc.find("@") access_token = parsed_url.netloc[colon_index + 1 : at_index]