vgit.nvim icon indicating copy to clipboard operation
vgit.nvim copied to clipboard

fix: Staging fails when cwd differs from repo root

Open MaxFangX opened this issue 1 month ago • 0 comments

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)

MaxFangX avatar Dec 11 '25 03:12 MaxFangX