Skip to content

Commit

Permalink
fix(git): cwd is sometimes required
Browse files Browse the repository at this point in the history
Commit e0fe17114 ("fix(git show): allow cwd outside root git dir")
removed the "./" prefix before the filename when cwd did not equal the
root git dir.

Some aspects of VGit like live gutter and hunk preview rely on this, so
replace with self.cwd instead.
  • Loading branch information
zdleaf authored and tanvirtin committed Mar 15, 2023
1 parent f8ef9c8 commit a62ad74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/vgit/git/cli/Git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ Git.show = loop.suspend(function(self, tracked_filename, commit_hash, spec, call
'-C',
self.cwd,
'show',
string.format('%s:%s', commit_hash, tracked_filename),
string.format('%s:%s%s', commit_hash, self.cwd, tracked_filename),
}),
on_stdout = function(line) result[#result + 1] = line end,
on_stderr = function(line) err[#err + 1] = line end,
Expand All @@ -658,7 +658,7 @@ Git.is_in_remote = loop.suspend(function(self, tracked_filename, commit_hash, sp
'-C',
self.cwd,
'show',
string.format('%s:%s', commit_hash, tracked_filename),
string.format('%s:%s%s', commit_hash, self.cwd, tracked_filename),
}),
on_stderr = function(line)
if line then
Expand Down

0 comments on commit a62ad74

Please sign in to comment.