Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setqflist("all") fails if submodule was modified #348

Closed
galli-miro opened this issue Sep 3, 2021 · 1 comment · Fixed by #359
Closed

setqflist("all") fails if submodule was modified #348

galli-miro opened this issue Sep 3, 2021 · 1 comment · Fixed by #359
Labels
bug Something isn't working

Comments

@galli-miro
Copy link

Description

When running

gitsigns.setqflist("all")

in a git repository with a modified submodule, the command fails. It complains that some path (the submodule) is a directory.

Neovim version

NVIM v0.5.0

Operating system and version

Linux 5.10.60-1-MANJARO

Steps to reproduce

  1. mkdir /tmp/temp
  2. cd cd /tmp/temp
  3. git init
  4. echo text >> file1
  5. git submodule add https://github.com/lewis6991/gitsigns.nvim
  6. git add .
  7. git commit -m 'Initial commit'
  8. echo text > gitsigns.nvim/file2
  9. nvim -nu minimal.lua file1
  10. :lua require('gitsigns').setqflist("all")

Expected behavior

The submodule should either be ignored or ideally the changed hunks in the submodule could also be added to the quickfix list.

Actual behavior

The command fails with the error:

E5108: Error executing lua ...fig/nvim/plugged/plenary.nvim/lua/plenary/async/util.lua:34: Blocking on future failed ....config/nvim/plugged/gitsigns.nvim/lua/gitsigns/util.lua:52: Is a direc
tory

Gitsigns debug messages

No response

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'

if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Gitsigns and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end

-- Load plugins
require('packer').startup {
  {
    'wbthomason/packer.nvim',
    {
      'lewis6991/gitsigns.nvim',
      requires = { 'nvim-lua/plenary.nvim' },
    },
    -- 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 },
  },
}

_G.load_config = function()
  require('gitsigns').setup{
    debug_mode = true, -- You must add this to enable debug messages
    -- GITSIGNS CONFIG THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
  }

  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE

  -- ALSO INCLUDE GITSIGNS DEBUG MESSAGES
  vim.cmd('Gitsigns debug_messages')
end

require('packer').sync()

vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
@galli-miro galli-miro added the bug Something isn't working label Sep 3, 2021
lewis6991 added a commit that referenced this issue Sep 9, 2021
lewis6991 added a commit that referenced this issue Sep 9, 2021
@galli-miro
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant