fix(diff): run remote diff git commands from repo root for monorepo subpaths#451
fix(diff): run remote diff git commands from repo root for monorepo subpaths#451
Conversation
…ubpaths Remote diffs showed no highlighted changes for monorepo subpath branches because `git diff -- <path>` resolved pathspecs relative to CWD (the subpath), doubling the path prefix. Fix by deriving just the clone directory for `resolve_branch_context` so all remote diff commands run from the repo root, making path resolution consistent across `diff --name-status`, `show <ref>:<path>`, and `diff -- <path>`. Also removes legacy `repo:` / `repos/` subpath format handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e repo-root logic The clone-dir derivation was duplicated between resolve_branch_context in diff_commands.rs and resolve_branch_workspace_subpath in branches.rs. Extract a shared resolve_branch_clone_dir helper so both call sites use the same code path and stay in sync if the logic ever changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21d2e22257
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let workspace_path = match &repo.subpath { | ||
| Some(subpath) => { |
There was a problem hiding this comment.
Preserve legacy subpath formats when resolving workspace paths
resolve_branch_workspace_subpath now always builds home:{clone_dir}/{subpath} and no longer recognizes legacy stored subpath formats (repo:<dir> / repos/...) that older project rows can still contain. For upgraded users with those rows, this returns a different directory than before (for example home:g2/repo:legacy), so downstream callers that execute git with -C against this path (e.g. workspace startup and remote branch operations) will fail to find the repository. Please keep the backward-compat parsing or migrate existing records before this path construction.
Useful? React with 👍 / 👎.
Summary
resolve_branch_clone_dirhelper to deduplicate the repo-root resolution logic shared between branches and diff commandsTest plan
🤖 Generated with Claude Code