Skip to content

fix: resolve --file paths from any directory in the repo#2927

Open
leno23 wants to merge 2 commits into
gitui-org:masterfrom
leno23:fix/file-flag-from-subdirectory-2871
Open

fix: resolve --file paths from any directory in the repo#2927
leno23 wants to merge 2 commits into
gitui-org:masterfrom
leno23:fix/file-flag-from-subdirectory-2871

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Resolve --file against the repository workdir instead of .git
  • Try both cwd-relative and workdir-relative paths so the flag works from subdirectories

Fixes #2871

Test plan

  • From repo root: gitui --file frontend/src/index.html
  • From frontend/: gitui --file src/index.html
  • From frontend/: gitui --file frontend/src/index.html

Made with Cursor

leno23 and others added 2 commits May 17, 2026 16:16
Strip the repository workdir (not .git) when converting --file to a
tree-relative path, and also try paths relative to the workdir root.

Fixes gitui-org#2871

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Flag --file not working on sub directories

1 participant