Skip to content

Commit 8caecf0

Browse files
committed
fix(#361): fix diff functionality not working when cwd does not match .git dir
1 parent a33f032 commit 8caecf0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/vgit/git/cli/Git.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ Git.show = loop.suspend(function(self, tracked_filename, commit_hash, spec, call
634634
'-C',
635635
self.cwd,
636636
'show',
637-
string.format('%s:%s%s', commit_hash, self.cwd, tracked_filename),
637+
string.format('%s:./%s', commit_hash, tracked_filename),
638638
}),
639639
on_stdout = function(line) result[#result + 1] = line end,
640640
on_stderr = function(line) err[#err + 1] = line end,
@@ -658,7 +658,7 @@ Git.is_in_remote = loop.suspend(function(self, tracked_filename, commit_hash, sp
658658
'-C',
659659
self.cwd,
660660
'show',
661-
string.format('%s:%s%s', commit_hash, self.cwd, tracked_filename),
661+
string.format('%s:./%s', commit_hash, tracked_filename),
662662
}),
663663
on_stderr = function(line)
664664
if line then

0 commit comments

Comments
 (0)