Skip to content

Commit b87c4bb

Browse files
committed
fix: ignore GIT_DIR and GIT_WORK_TREE environment variables
1 parent 43c3600 commit b87c4bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/rocks-git/git.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ local nio = require("nio")
2828
---@see vim.system
2929
local function git_cli(args, on_exit, opts)
3030
opts = opts or {}
31+
opts.env = opts.env or {}
32+
-- Edge case, see https://github.com/nvim-neorocks/rocks-git.nvim/issues/78
33+
opts.env.GIT_DIR = nil
34+
opts.env.GIT_WORK_TREE = nil
3135
local git_cmd = vim.list_extend({
3236
"git",
3337
}, args)

0 commit comments

Comments
 (0)