Skip to content

fix(#3366): api.git.reload() not functional when filesystem_watchers.enable = false - #3367

Open
ytret wants to merge 1 commit into
nvim-tree:masterfrom
ytret:fix-upstream-issue-3366
Open

ytret wants to merge 1 commit into
nvim-tree:masterfrom
ytret:fix-upstream-issue-3366

Conversation

@ytret

@ytret ytret commented Oct 18, 2026

Copy link
Copy Markdown

Fixes #3366

Current implementation of Explorer:reload_git() uses the old git.config table:

function Explorer:reload_git()
  if not git.config.git or not git.config.git.enable or event_running then
    return
  end
  -- <...>
end

Its init was removed in 3d385d3 (commit 4146915 within the PR), and it's been empty since then, that's why the if branch is always taken and Explorer:reload_git() returns prematurely.

Fix this by using the config.g.git.enable value. No need to check if config.g.git is defined because it is always set here.

@ytret ytret closed this Oct 18, 2026
@ytret
ytret deleted the fix-upstream-issue-3366 branch October 18, 2026 12:50
@ytret
ytret restored the fix-upstream-issue-3366 branch October 18, 2026 12:50
@ytret
ytret deleted the fix-upstream-issue-3366 branch October 18, 2026 12:50
@ytret
ytret restored the fix-upstream-issue-3366 branch October 18, 2026 12:50
The commit 3d385d3 (pull request nvim-tree#3295)
removed `git.setup()` that populated the `git.config.git` table, but
didn't replace all uses of `git.config.git` with the new `config.g.git`
table.

More specifically, it missed `Explorer:reload_git()`, which saw the
empty `git.config.git` table and returned prematurely.

Fix it by reading the config value from `config.g.git.enable`.
@ytret ytret reopened this Oct 18, 2026
@ytret
ytret force-pushed the fix-upstream-issue-3366 branch from edabd7c to 1a3ccfb Compare October 18, 2026 12:52
@ytret

ytret commented Oct 18, 2026

Copy link
Copy Markdown
Author

Sorry had a trouble with the GitHub interface

@alex-courtis alex-courtis changed the title fix(#3366): fix git status reload after config migration fix(#3366): api.git.reload() not functional when filesystem_watchers.enable = false Oct 18, 2026

@alex-courtis alex-courtis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for the excellent report/reproducer and contribution.

Good catch identifying that git.config is the incorrect table. I'd be most grateful if you could remove it so that we don't have any future problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracked file still shown as untracked after git.reload()

2 participants