Skip to content

fix(git): keep status paths relative to cwd#2542

Open
fengjikui wants to merge 1 commit into
rtk-ai:developfrom
fengjikui:codex/fix-git-status-relative-paths
Open

fix(git): keep status paths relative to cwd#2542
fengjikui wants to merge 1 commit into
rtk-ai:developfrom
fengjikui:codex/fix-git-status-relative-paths

Conversation

@fengjikui

Copy link
Copy Markdown

Fixes #2373.

Summary

  • keep compact rtk git status paths relative to the caller's current subdirectory
  • preserve paths outside the subdirectory as ../..., matching native git status --short
  • keep quoted paths, renames, current-directory untracked dirs, and non-ASCII prefixes covered by tests

Root cause

Compact status uses git status --porcelain -b, whose v1 porcelain paths are repo-root relative. In a monorepo subdirectory, that made RTK print paths like apps/web/local_subdir/file.py while native git status prints local_subdir/file.py.

Validation

  • cargo fmt --all
  • cargo test test_build_status_command
  • cargo test test_format_status_output_relative
  • cargo test test_git_status_paths_are_relative_to_current_subdir -- --ignored
  • manual temp-repo checks for sibling paths and non-ASCII subdirectory prefixes
  • cargo clippy --all-targets
  • cargo test --all

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.

git status wrapper forces full path from git root

1 participant