NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
3.62k stars 218 forks source link

Can't handle `typechange` #1408

Open subnut opened 4 days ago

subnut commented 4 days ago

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.

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

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