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

Can't handle typechange #1408

Open
subnut opened this issue Jul 1, 2024 · 0 comments
Open

Can't handle typechange #1408

subnut opened this issue Jul 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@subnut
Copy link

subnut commented Jul 1, 2024

Description

Neogit currently fails to handle typechange diffs.

These generally happen when the type of a file changes from symlink to a regular file, or from a regular file to a symlink.

  • The item.mode for typechange is T
  • The default status.mode_text that's returned by get_default_values() currently has no index called "T"

I'm sure you can see what the problem is.

Since status.mode_text["T"] returns nil, any code that expects status.mode_text[item.mode] to be a string is gonna break.

Neovim version

any

Operating system and version

any

Steps to reproduce

  • mkdir temp
  • git init
  • touch foo
  • git add foo
  • git commit -m foo
  • rm foo
  • ln -s bar foo
  • nvim +Neogit

Expected behavior

Everything works fine

Actual behavior

...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: ...ra/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:401: attempt to get length
of local 's' (a nil value)
stack traceback:
	[C]: in function 'error'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'step'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:48: in function 'execute'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:118: in function 'callback'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'saved_callback'
	...are/nvim/lazy/plenary.nvim/lua/plenary/async/control.lua:126: in function 'tx'
	.../share/nvim/lazy/plenary.nvim/lua/plenary/async/util.lua:67: in function 'callback'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
	...era/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:301: in function <...era/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:263>

Minimal config

-- any
@subnut subnut added the bug Something isn't working label Jul 1, 2024
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

1 participant