-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
vim-fugitive diffs result in error about invalid object name 0 #1185
Comments
I can reproduce just by doing Just to ask, Is there any reason you use |
Honestly only reason is because the index buffer is a fugitive buffer, so it works with things like |
Not sure if you know, but the Gitsigns diff buffer is a normal buffer you can write (with I'd been keen to know if there's anything else you'd like to see in this area. |
With your most recent fix, now I get:
When simply opening Anyway...
|
Oh I see. Isn't that the same as
You need to edit the diff buffer first. When you save, it'll stage those edits. You can do this in fugitive diff buffers too. |
Fixed? 🤞 |
Not exactly. Try it out. Make some changes in a file, but don't stage it or anything. Then do a Basically,
Got it. Yeah, the
Yes! 🎉🚀 Thanks! |
If you don't make any changes to index buffer, then
So the main difference is due to the fact that the index buffer may have unsaved edits? If not then it won't be staging anything, it'll just reset the working copy (and buffer), whereas |
It writes both. It doesn't appear to do anything to the index because you're writing exactly what's already in the index directly back into it. If the index buffer is an older version of the file (from
In a nutshell, it'll update the work tree file and the index to exactly the contents of the buffer you use |
Description
When viewing a diff with vim-fugitive, gitsigns throws this error:
Neovim version
NVIM v0.11.0-dev-1623+g34d808b73c
Operating system and version
RHEL 8
Expected behavior
No response
Actual behavior
Shouldn't error.
Minimal config
Steps to reproduce
mkdir gitsigns_issue
cd gitsigns_issue
git init
touch file
git add file
git commit -m 'initial commit'
nvim --clean -u minimal.lua file
:Gvdiff
Gitsigns debug messages
Gitsigns cache
The text was updated successfully, but these errors were encountered: