firstsun-dev_git-files-sync/tests/services
ClaudiaFang c28e0ec09a perf(push): batch-commit push-all files + SHA-based diffing
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>
2026-07-14 09:58:06 +00:00
..
git-service-base.test.ts perf(push): batch-commit push-all files + SHA-based diffing 2026-07-14 09:58:06 +00:00
gitea-service.test.ts perf(push): batch-commit push-all files + SHA-based diffing 2026-07-14 09:58:06 +00:00
github-service.test.ts perf(push): batch-commit push-all files + SHA-based diffing 2026-07-14 09:58:06 +00:00
gitlab-service.test.ts perf(push): batch-commit push-all files + SHA-based diffing 2026-07-14 09:58:06 +00:00
service-test-helpers.ts fix(sync): clearer branch-not-found errors and connection test 2026-07-05 04:57:47 +00:00