Skip to content

git runner logging error during table concat with nil #1494

Closed
@AxLauri

Description

@AxLauri

Description

When git option is enabled and the .gitconfig contains no value for status.showUntrackedFiles, an invalid value (nil) at index 5 in table for 'concat' is encountered. This is worked around by adding an appropriate value to the .gitconfig for status.showUntrackedFiles.

Appears this could be be resolved by handling the nil prior to loggingthis could be handled with a check for the nil value in that table pri

Neovim version

NVIM v0.8.0-dev-699-gcbfae548e
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Operating system and version

Windows 10

nvim-tree version

261a5c3

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup {
    {
      "wbthomason/packer.nvim",
      "kyazdani42/nvim-tree.lua",
      "kyazdani42/nvim-web-devicons",
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  }
end
if vim.fn.isdirectory(install_path) == 0 then
  print "Installing nvim-tree and dependencies."
  vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
  require("nvim-tree").setup {
      git = {
        enable = true,
      }
  }
end

Steps to reproduce

  1. .gitconfig for cwd should have no entry for status.showUntrackedFiles
  2. nvim -nu /tmp/nvt-min.lua
  3. :NvimTreeOpen
  4. Create new file within NvimTree

Expected behavior

Expect NvimTree to open without error

Actual behavior

Encounter error:

Error executing vim.schedule lua callback: ...\packer\start\nvim-tree.lua/lua/nvim-tree/git/runner.lua:89: invalid value (nil) at index 5 in table for 'concat'
stack traceback:
[C]: in function 'concat'
...\packer\start\nvim-tree.lua/lua/nvim-tree/git/runner.lua:89: in function '_run_git_job'
...\packer\start\nvim-tree.lua/lua/nvim-tree/git/runner.lua:146: in function 'run'
...ck\packer\start\nvim-tree.lua/lua/nvim-tree/git/init.lua:38: in function 'reload_project'
...ker\start\nvim-tree.lua/lua/nvim-tree/explorer/watch.lua:10: in function 'reload_and_get_git_project'
...ker\start\nvim-tree.lua/lua/nvim-tree/explorer/watch.lua:50: in function 'refresh_path'
...ker\start\nvim-tree.lua/lua/nvim-tree/explorer/watch.lua:68: in function 'callback'
...\pack\packer\start\nvim-tree.lua/lua/nvim-tree/utils.lua:358: in function <...\pack\packer\start\nvim-tree.lua/lua/nvim-tree/utils.lua:357>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions