mirror of
https://github.com/firstsun-dev/git-files-sync.git
synced 2026-07-22 17:20:30 +00:00
Follow-up to the push-all batching work: batch-deleting remote-only files via the sync status panel's checkbox multi-select was still N separate commits (SyncStatusView.performRemoteDeletion looped gitService.deleteFile once per file). - Add optional GitServiceInterface.deleteBatch, mirroring pushBatch. GitHub/Gitea implement it via the git blob->tree->commit->ref Data API, reusing resolveGitHubStyleBaseTree/resolveBaseTree and commitGitHubStyleTree (widened its tree-item sha type to string | null -- a null sha removes that path from the resulting tree, GitHub's way of expressing a delete at the tree level). GitLab implements it via the same Commits API endpoint pushBatch already uses, with action: 'delete' entries. - SyncStatusView.performRemoteDeletion now calls deleteBatch once per chunk (MAX_BATCH_PUSH_SIZE, reused from the push work) when the provider supports it; a failed chunk marks every path in it as failed rather than dropping results silently. The original per-file loop is preserved verbatim as performRemoteDeletionSequential, the fallback for providers without deleteBatch. Local deletion is unaffected -- it's a local vault operation, not a git commit. Evidence: npx eslint . -> 0 errors; npm run build -> clean; npx vitest run -> 339/339 passed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| git-service-base.test.ts | ||
| gitea-service.test.ts | ||
| github-service.test.ts | ||
| gitlab-service.test.ts | ||
| service-test-helpers.ts | ||