mirror of
https://github.com/firstsun-dev/git-files-sync.git
synced 2026-07-22 17:20:30 +00:00
GitHubService.pushBatch/deleteBatch previously created each file's blob with a REST POST .../git/blobs call before the tree/commit/ref sequence, so an N-file batch still cost N/8 rounds of latency-bound round trips even with concurrency. Switched to GitHub's createCommitOnBranch GraphQL mutation, which carries file content directly in the request body, cutting an N-file batch to 2-3 HTTP calls total. - Extracted BaseGitService.getLatestCommitSha from resolveGitHubStyleBaseTree, which is still used by pushSymlink (GraphQL's FileAddition has no file-mode field) and Gitea's batch methods (no GraphQL API). - Added explicit handling for GraphQL's 200-status-with-errors-array failure mode, which REST's status-code check can't catch. - Verified against a live GitHub repo: pushBatch/deleteBatch each produced one commit with correct content and blob shas. |
||
|---|---|---|
| .. | ||
| git-service-base.test.ts | ||
| gitea-service.test.ts | ||
| github-service.test.ts | ||
| gitlab-service.test.ts | ||
| service-test-helpers.ts | ||