Skip to content

fix: path resolution, wasted git calls, parallel status#5

Open
sulthonzh wants to merge 1 commit into
fix/round4-resolver-cwd-editor-split-countfrom
fix/path-resolution-wasted-calls
Open

fix: path resolution, wasted git calls, parallel status#5
sulthonzh wants to merge 1 commit into
fix/round4-resolver-cwd-editor-split-countfrom
fix/path-resolution-wasted-calls

Conversation

@sulthonzh

Copy link
Copy Markdown
Owner

Found while reviewing latest code (on top of the pending branch fixes):

Bugs Fixed

  1. ConflictResolver path resolution ignores workingDirvalidateResolution, getConflictCount, and openInEditor all did resolve(filePath) which resolves against process.cwd(), not the git working directory. If someone uses the library with a cwd parameter (or runs the CLI from a parent directory), files wouldn't be found.

  2. Wasted git.status() call in getConflictedFiles — Called this.git.status() and immediately discarded the result. The actual conflict detection is done via git diff. This spawns an unnecessary git subprocess every time.

  3. Sequential git calls in getConflictStatusgetConflictedFiles() and getMergeInfo() were called sequentially, but they're independent. Now runs in parallel with Promise.all.

  4. Removed unused StatusFile interface — Dead code.

All 11 tests pass.

…l, optimize getConflictStatus

- ConflictResolver now stores workingDir and uses it for all resolve() calls
  (fixes files not found when cwd differs from git working directory)
- Removed unused git.status() call in getConflictedFiles (was discarded anyway)
- getConflictStatus runs getConflictedFiles + getMergeInfo in parallel
- Removed unused StatusFile interface
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.

1 participant