fix: 修复update指令commit数量显示的问题

This commit is contained in:
Soulter
2023-04-05 20:32:15 +08:00
parent 0a1df90a83
commit ce476ca163
+2 -2
View File
@@ -36,7 +36,7 @@ class Command:
repo = Repo(path="QQChannelChatGPT")
now_commit = repo.head.commit
# 得到最新的5条commit列表, 包含commit信息
# 得到最新的3条commit列表, 包含commit信息
origin = repo.remotes.origin
origin.fetch()
commits = list(repo.iter_commits('master', max_count=3))
@@ -47,7 +47,7 @@ class Command:
index+=1
remote_commit_hash = origin.refs.master.commit.hexsha[:6]
return True, f"当前版本: {now_commit.hexsha[:6]}\n最新版本: {remote_commit_hash}\n\n最新5条commit:\n{str(commits_log)}\n使用update latest更新至最新版本\n"
return True, f"当前版本: {now_commit.hexsha[:6]}\n最新版本: {remote_commit_hash}\n\n最新3条commit:\n{str(commits_log)}\n使用update latest更新至最新版本\n"
else:
if l[1] == "latest":
try: