Skip to content

Conversation

@MaxFangX
Copy link
Contributor

When GitFile(filename) was created with a relative path, git_repo.discover() resolved it relative to the current working directory. If the user :cd'd to a subdirectory, paths got resolved incorrectly and staging operations silently failed.

  • DiffScreen: Use self.git_file instead of creating new GitFile
  • ProjectDiffScreen: Construct absolute paths using stored reponame
  • Remove redundant filename params from Model methods
  • Remove redundant git_repo.discover() calls (use stored reponame)
  • Fix extra unused arg in git_file:unstage(filename)

When `GitFile(filename)` was created with a relative path,
`git_repo.discover()` resolved it relative to the current working
directory. If the user `:cd`'d to a subdirectory, paths got resolved
incorrectly and staging operations silently failed.

- DiffScreen: Use `self.git_file` instead of creating new GitFile
- ProjectDiffScreen: Construct absolute paths using stored reponame
- Remove redundant `filename` params from Model methods
- Remove redundant `git_repo.discover()` calls (use stored reponame)
- Fix extra unused arg in `git_file:unstage(filename)`
@tanvirtin tanvirtin merged commit edc01bb into tanvirtin:main Dec 15, 2025
1 of 2 checks passed
@MaxFangX MaxFangX deleted the 12-10-cwd-repo-root-fix branch December 15, 2025 18:02
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