mirror of
https://github.com/firstsun-dev/git-files-sync.git
synced 2026-07-22 17:20:30 +00:00
Push-all was up to 3N sequential HTTP calls and N separate commits for N files (getFile check -> pushFile PUT -> optional extra getFile), plus two redundant full remote-tree fetches per run (one discarded in main.ts, one inside GitignoreManager). - Add optional GitServiceInterface.pushBatch. GitHub/Gitea implement it via the git blob->tree->commit->ref Data API, generalizing pushSymlink's existing pattern into shared resolveGitHubStyleBaseTree/commitGitHubStyleTree helpers in git-service-base.ts. GitLab implements it via its native multi-file Commits API (actions array), with a follow-up listFilesDetailed call to recover each file's new blob sha since that endpoint doesn't return them. Symlinks stay on the existing per-file pushSymlink path. - sync-manager.ts's push-all flow now classifies each file by comparing a locally-computed git blob sha (utils/git-blob-sha.ts, already used by the feat-006 status refresh) against a pre-fetched remote tree's per-entry sha, eliminating the per-file getFile call for the common case. Queued files are committed in one grouped pushBatch call, chunked at MAX_BATCH_PUSH_SIZE=200; a failed chunk marks every file in it as failed rather than dropping results silently. Providers without pushBatch fall back to the original sequential path. - main.ts fetches the remote tree once per push/pull-all run and threads it into both GitignoreManager.loadGitignores(tree) and SyncManager.pushAllFiles(files, onProgress, tree), replacing the previously-discarded listFiles() call and gitignore-manager's separate fetch with one shared call. Rename detection and the pull-all path are unchanged (out of scope). Evidence: npx eslint . -> 0 errors; npm run build -> clean; npx vitest run -> 330/330 passed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| i18n | ||
| logic | ||
| services | ||
| ui | ||
| utils | ||
| changelog.test.ts | ||
| setup.ts | ||