We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c42f9d3 commit 978b052Copy full SHA for 978b052
lua/nvim-tree/explorer/watch.lua
@@ -8,8 +8,11 @@ local M = {
8
}
9
10
local function is_git(path)
11
- -- If $GIT_DIR is set, consider its value to be equivalent to '.git'
12
- if path == vim.env.GIT_DIR then
+ -- If $GIT_DIR is set, consider its value to be equivalent to '.git'.
+ -- Expand $GIT_DIR (and `path`) to a full path (see :help filename-modifiers), since
13
+ -- it's possible to set it to a relative path. We want to make our best
14
+ -- effort to expand that to a valid absolute path.
15
+ if vim.fn.fnamemodify(path, ":p") == vim.fn.fnamemodify(vim.env.GIT_DIR, ":p") then
16
return true
17
elseif vim.fn.fnamemodify(path, ":t") == ".git" then
18
0 commit comments