Fix parsing of 'git ls-files -v' for filenames with spaces

Fixes #829.
This commit is contained in:
Andy Stewart
2022-04-25 13:33:45 +01:00
parent 2f359076bc
commit 5dd8ab6211
2 changed files with 18 additions and 2 deletions

View File

@@ -205,6 +205,20 @@ function Test_filename_with_square_brackets()
endfunction
function Test_filename_with_space()
call system('touch fix\ ture.txt && git add fix\ ture.txt')
edit fix\ ture.txt
normal ggo*
call s:trigger_gitgutter()
let expected = [
\ {'lnum': 1, 'name': 'GitGutterLineAdded'},
\ {'lnum': 2, 'name': 'GitGutterLineAdded'}
\ ]
call s:assert_signs(expected, 'fix\ ture.txt')
endfunction
function Test_filename_leading_dash()
call system('touch -- -fixture.txt && git add -- -fixture.txt')
edit -fixture.txt