Open przepompownia opened 3 months ago
This is because the logic that attach_to_untracked
drives attach()
:
if not config.attach_to_untracked and git_obj.object_name == nil then
dprint('File is untracked')
return
end
attach()
does a lot of checks to make sure the buffer is attachable. I'm not how else to implement this so attach()
ignores only some of these checks.
I'm not encouraging you to make any bigger effort here, especially that this issue is only a side effect of working on a minimal reproduction environment. I have set attach_to_untracked
to true in my real environment.
FWIW I think it would be nice if it worked. If a user has attach_to_untracked = false
, :Gitsigns attach
provides a convenient way to stage an untracked buffer.
Description
For reporting previous issues I tested Gitsigns without
attach_to_untracked
(false by default since some moment) and found that I cannot manually attach new untracked file.Neovim version
v0.11.0-dev-124+g90a4b1a59
Operating system and version
Debian Sid
Expected behavior
:Gitsigns attach
works independently ofattach_to_untracked
.Actual behavior
:Gitsigns attach
seems to not work.Minimal config
Steps to reproduce
Inside some Git repo
nvim --clean -u minimal.lua
new3Gitsigns attach
:Gistigns stage_buffer
GIT_PAGER= git diff --staged -- new3
Gitsigns debug messages