From e3389087e1edec460e9483fceec871a344fc26aa Mon Sep 17 00:00:00 2001 From: KimigaiiWuyi <444835641@qq.com> Date: Fri, 27 Sep 2024 04:30:48 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20`core=E5=85=A8=E9=83=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0`=E6=97=B6=E6=9C=89=E6=A6=82=E7=8E=87=E4=BA=A7?= =?UTF-8?q?=E7=94=9F=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gsuid_core/client.py | 2 +- gsuid_core/utils/plugins_update/_plugins.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gsuid_core/client.py b/gsuid_core/client.py index 4527dad..6709741 100644 --- a/gsuid_core/client.py +++ b/gsuid_core/client.py @@ -48,7 +48,7 @@ class GsClient: intent = await self._input() content = Message(type='text', data=intent) group_id = random.choice(['8888', '88888']) - user_id = random.choice(['99999', '9999', '66666', '555']) + user_id = random.choice(['99999']) msg = MessageReceive( bot_id='console', # bot_id='qqgroup', diff --git a/gsuid_core/utils/plugins_update/_plugins.py b/gsuid_core/utils/plugins_update/_plugins.py index 29c40f6..7dd0fcf 100644 --- a/gsuid_core/utils/plugins_update/_plugins.py +++ b/gsuid_core/utils/plugins_update/_plugins.py @@ -384,10 +384,16 @@ def update_from_git( logger.info(f'[更新][{plugin_name}] 正在执行 git fetch') o.fetch() - default_branch_ref = repo.git.symbolic_ref('refs/remotes/origin/HEAD') - default_branch = default_branch_ref.split('/')[-1] # 提取主分支名称 + try: + default_branch_ref = repo.git.symbolic_ref('refs/remotes/origin/HEAD') + default_branch = default_branch_ref.split('/')[-1] # 提取主分支名称 - commits_diff = list(repo.iter_commits(f'HEAD..origin/{default_branch}')) + commits_diff = list( + repo.iter_commits(f'HEAD..origin/{default_branch}') + ) + except GitCommandError as e: + logger.warning(f'[更新] 查找默认分支失败...{e}!') + commits_diff = list(repo.iter_commits(max_count=40)) if level >= 2: logger.warning(f'[更新][{plugin_name}] 正在执行 git clean --xdf')