gitsigns.nvim/test
Lewis Russell c097cb2550 fix(stage): staging of files with no nl at eof
Previously when diffing two files where one did not have a newline at
the end of the file, gitsigns was unable to stage such differences since
this information was not captured during the diff stage.

If you run `vim.diff('a', 'a\n')` you get the result:

    @@ -1 +1 @@
    -a
    \ No newline at end of file
    +a

However if you run `vim.diff('a', 'a\n', {result_type='indices'})` you
get:

    { {1, 1, 1, 1} }

And since Gitsigns tracks changes as a list of text lines, the
information about a missing newline at the end of the file is not
correctly tracked.

The main consequence of this is that staging hunks which contain these
lines would result in an error as the generated patch would not apply
since it was missing "\ No newline at end of file".

To fix this, the internal hunk object now tracks this end of file
information and patches are now generated correctly.
2024-04-10 15:53:16 +01:00
..
actions_spec.lua fix(stage): staging of files with no nl at eof 2024-04-10 15:53:16 +01:00
gitdir_watcher_spec.lua test: simplify msgpack_rpc_stream 2024-01-25 17:19:25 +00:00
gitsigns_spec.lua chore: stylua 2024-04-03 17:21:49 +01:00
gs_helpers.lua test: migrate to nvim-test 2024-04-03 16:56:07 +01:00
highlights_spec.lua test: migrate to nvim-test 2024-04-03 16:56:07 +01:00
unit_spec.lua chore: stylua test code 2023-10-05 16:25:10 +01:00