Skip to content

Refactor/consolidate git adapter#25

Merged
ozgen merged 12 commits intomainfrom
refactor/consolidate-git-adapter
Mar 1, 2026
Merged

Refactor/consolidate git adapter#25
ozgen merged 12 commits intomainfrom
refactor/consolidate-git-adapter

Conversation

@ozgen
Copy link
Owner

@ozgen ozgen commented Mar 1, 2026

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Mar 1, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 95.65217% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.26%. Comparing base (9b9a163) to head (1c5a3fc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/adapters/git/gitCliClient.ts 95.60% 0 Missing and 4 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
+ Coverage   91.15%   92.26%   +1.11%     
==========================================
  Files          37       33       -4     
  Lines        1029      983      -46     
  Branches      243      230      -13     
==========================================
- Hits          938      907      -31     
+ Misses         18       13       -5     
+ Partials       73       63      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ozgen added 8 commits March 1, 2026 18:19
Add getStagedPaths, getUntrackedPaths, isNewFileInRepo, fileExistsAtRef,
getHeadMessage, isHeadEmptyVsParent, commit, push, and discardFiles to the
GitClient interface. Export getStagedFilesInGroup as a pure helper so callers
don't need to import from src/git/.
Move looksLikeNoUpstream and all git operations (staged paths, untracked
paths, file existence checks, HEAD info, commit, push with upstream fallback,
discard) from src/git/* into GitCliClient. GitCliClient is now the single
authoritative git adapter.
All registration modules now call git operations through the injected
GitClient (deps.git) instead of importing free functions from src/git/.
Removes direct coupling to the old parallel git execution system.
Replace runGit/getUntrackedPaths free-function imports in use cases with
GitClient method calls. Introduce a GitPort type in handleNewFilesCreated
to keep the dependency explicit without coupling to the full interface.
Strip runGit, runGitCapture, and getUntrackedPaths from process.ts —
these are now handled by GitCliClient. Delete the entire src/git/ directory
(head.ts, push.ts, refs.ts, staged.ts) as all logic has been migrated.
Add tests for all new GitCliClient methods (getStagedPaths, getUntrackedPaths,
isNewFileInRepo, fileExistsAtRef, getHeadMessage, isHeadEmptyVsParent, commit,
push, discardFiles). Remove src/test/unit/git/ tests for deleted modules.
Update process.test.ts and reconcileWithGitStatus.test.ts to match the new
structure. Fix mockExecFileWithRouter to propagate error messages correctly.
@ozgen ozgen force-pushed the refactor/consolidate-git-adapter branch from 5fbb6d3 to d7a3192 Compare March 1, 2026 17:24
ozgen added 4 commits March 1, 2026 18:26
Add missing methods (getStagedPaths, getUntrackedPaths, isNewFileInRepo,
fileExistsAtRef, getHeadMessage, isHeadEmptyVsParent, commit, push,
discardFiles, stashListFiles) to the four test files whose makeGit
factory is strictly typed as GitClient.
runCmdCapture, runCmd, and runGhCapture were no longer referenced
anywhere after git operations were consolidated into GitCliClient.
@ozgen ozgen merged commit 4426fd7 into main Mar 1, 2026
2 checks passed
@ozgen ozgen deleted the refactor/consolidate-git-adapter branch March 1, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants