Skip to content

fix: 修复 Gitlab、Gitea 无法拉取历史记录的问题#950

Merged
codexu merged 4 commits intodevfrom
fix/gitlab-sync-404
Mar 6, 2026
Merged

fix: 修复 Gitlab、Gitea 无法拉取历史记录的问题#950
codexu merged 4 commits intodevfrom
fix/gitlab-sync-404

Conversation

@codexu
Copy link
Copy Markdown
Owner

@codexu codexu commented Mar 6, 2026

No description provided.

codexu and others added 4 commits March 6, 2026 17:24
- 添加自定义 URL 验证:移除末尾斜杠、确保包含协议
- 添加 Access Token 验证
- 修复路径编码问题:避免双重编码
- 改进 getFiles 错误处理:区分 404 和其他错误
- 顺便修复 Gitea 中未使用参数的类型错误

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- sync-push-queue: GitLab/Gitea 上传前先获取远程文件 SHA
- 与 GitHub/Gitee 保持一致:先 getFiles 获取 SHA 再上传
- 上传时传递 sha 参数,GitLab 会自动获取 last_commit_id
- 上传后检查结果是否成功,避免无效上传也被标记为成功
- 修复 getFileCommits/getFileContent 路径编码问题
- 修复 history-sheet 从 { data } 对象正确提取提交历史

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- GitLab getFileContent 返回 base64 编码内容,需要解码
- Gitea getFileContent 返回 base64 编码内容,需要解码
- 添加与 GitHub/Gitee 一致的 base64 解码逻辑

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- getFiles: 添加 sha 参数支持,获取特定分支的文件内容
- getFileContentFromCommit: 新增函数,使用 Git tree API 获取特定 commit 的文件内容
- history-sheet: 保存完整 SHA 用于恢复功能,正确提取提交历史数据
- 移除调试日志

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@codexu codexu merged commit 07aa1ed into dev Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant