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

Gitsigns assertion error in folder not using git #989

Closed
Kayzels opened this issue Apr 17, 2024 · 1 comment
Closed

Gitsigns assertion error in folder not using git #989

Kayzels opened this issue Apr 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Kayzels
Copy link

Kayzels commented Apr 17, 2024

Description

Whenever I open a file in a folder that isn't part of a git repo, I get an error about an assertion failure.

As this file is not in a git repo, I don't expect gitsigns to be running, or providing error messages.

Neovim version

NVIM v0.10.0-dev-2930+g47ba96a6b
Build type: RelWithDebInfo
LuaJIT 2.1.1710088188

Operating system and version

Windows 10 Pro 22H2 19045.3803

Expected behavior

No popup or error for folders not part of a git repo

Actual behavior

Popup about assertion error executing luv callback:

Error executing luv callback:
... Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/async.lua:85: The coroutine failed with this message: ...im Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/git.lua:337: assertion failed!
stack traceback:
	[C]: in function 'assert'
	...im Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/git.lua:337: in function 'try_yadm'
	...im Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/git.lua:372: in function 'new'
	...im Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/git.lua:829: in function 'new'
	...Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/attach.lua:270: in function 'fn'
	...tsigns\gitsigns_issue\gitsigns/lua/gitsigns/debounce.lua:68: in function 'attach_throttled'
	...Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/attach.lua:424: in function <...Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/attach.lua:423>
stack traceback:
	[C]: in function 'error'
	... Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/async.lua:85: in function 'cb'
	... Gitsigns\gitsigns_issue\gitsigns/lua/gitsigns/async.lua:127: in function 'on_exit'
	...gram Files\Neovim\share\nvim\runtime/lua/vim/_system.lua:300: in function <...gram Files\Neovim\share\nvim\runtime/lua/vim/_system.lua:270>

Minimal config

for name, url in pairs{
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
} do
  local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.opt.runtimepath:append(install_path)
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
}

Steps to reproduce

  1. nvim --clean -u minimal.lua
  2. Open a file not in a git repo (including the minimal.lua above)

Gitsigns debug messages

Excluding the lines for deriving the signs

signs.init: Using extmark signs
attach(1): Attaching (trigger=BufReadPost)
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 config user.name
run_job: git --version
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 rev-parse --show-toplevel --absolute-git-dir --abbrev-ref HEAD
cli.run: Running action 'debug_messages' with arguments {}
cli.run: Running action 'debug_messages' with arguments {}
@Kayzels Kayzels added the bug Something isn't working label Apr 17, 2024
@lewis6991
Copy link
Owner

Thanks for the report. Should be fixed.

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
Development

No branches or pull requests

2 participants