Skip to content

Commit 2b368ce

Browse files
tsukimizakeAntoineGS
authored andcommitted
Fix git command for nushell compatibility
Replace 'cd && git' with 'git -C' to avoid issues with nushell which doesn't support command substitution with cd in the same way as bash/zsh.
1 parent 93adf98 commit 2b368ce

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/copilot/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function M.get_copilot_lua_version()
3333
if not copilot_lua_version then
3434
local plugin_version_ok, plugin_version = pcall(function()
3535
local plugin_dir = M.get_plugin_path()
36-
return vim.fn.systemlist(string.format("cd %s && git rev-parse HEAD", plugin_dir))[1]
36+
return vim.fn.systemlist(string.format("git -C %s rev-parse HEAD", plugin_dir))[1]
3737
end)
3838
copilot_lua_version = plugin_version_ok and plugin_version or "dev"
3939
end

0 commit comments

Comments
 (0)