firstsun-dev_git-files-sync/tests
Claude 339d5cbe77
fix(services): omit blank sha so creating a new file doesn't 422
Pushing a new file via the single-file push button failed with GitHub
HTTP 422. A 404 lookup returns sha === '' for new files, and the manual
push path (sync-manager pushFile/conflict resolution) forwarded that
empty string into the Contents API request body as "sha":"", which
GitHub rejects. Batch push avoided this via `remote.sha || undefined`.

Fix at the service layer so every caller is safe: only include sha in the
GitHub request body when it is non-empty. Apply the same guard to the
GitLab service's last_commit_id for symmetry.

Add regression tests for blank-sha pushes on both services.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
2026-06-26 06:07:59 +00:00
..
logic refactor(test): eliminate duplicate code flagged by SonarCloud 2026-05-22 03:52:32 +00:00
services fix(services): omit blank sha so creating a new file doesn't 422 2026-06-26 06:07:59 +00:00
ui fix(test): add @types/jsdom and fix Element type cast in setup-dom 2026-05-20 08:59:05 +00:00
utils refactor(test): eliminate duplicate code flagged by SonarCloud 2026-05-22 03:52:32 +00:00
setup.ts test(ui): add interaction tests for ActionBar, FileListItem, and DiffPanel 2026-05-20 05:25:13 +00:00