From 8caecf06c8fede4857568f64ff4349b6945362f0 Mon Sep 17 00:00:00 2001 From: tanvirtin Date: Thu, 6 Jun 2024 18:32:16 -0400 Subject: [PATCH] fix(#361): fix diff functionality not working when cwd does not match .git dir --- lua/vgit/git/cli/Git.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/vgit/git/cli/Git.lua b/lua/vgit/git/cli/Git.lua index d3df46d1..2638f074 100644 --- a/lua/vgit/git/cli/Git.lua +++ b/lua/vgit/git/cli/Git.lua @@ -634,7 +634,7 @@ Git.show = loop.suspend(function(self, tracked_filename, commit_hash, spec, call '-C', self.cwd, 'show', - string.format('%s:%s%s', commit_hash, self.cwd, tracked_filename), + string.format('%s:./%s', commit_hash, tracked_filename), }), on_stdout = function(line) result[#result + 1] = line end, 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 '-C', self.cwd, 'show', - string.format('%s:%s%s', commit_hash, self.cwd, tracked_filename), + string.format('%s:./%s', commit_hash, tracked_filename), }), on_stderr = function(line) if line then