Skip to content

Commit d5662d4

Browse files
authored
fix: Regression in finding top-level (#249)
1 parent e0c8118 commit d5662d4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lua/diffview/vcs/adapters/git/init.lua

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ end
9090
---@param path string
9191
---@return string?
9292
local function get_toplevel(path)
93-
local out, code = utils.system_list(vim.tbl_flatten({
94-
config.get_config().git_cmd,
95-
{ "rev-parse", "--path-format=absolute", "--show-toplevel" },
96-
path
97-
}))
93+
local out, code = utils.system_list(
94+
vim.tbl_flatten({
95+
config.get_config().git_cmd,
96+
{ "rev-parse", "--path-format=absolute", "--show-toplevel" },
97+
}),
98+
{ cwd = path }
99+
)
100+
98101
if code ~= 0 then
99102
return nil
100103
end

0 commit comments

Comments
 (0)