Skip to content

Commit 6a8dbf0

Browse files
committed
fix: #1457
closes #1458
1 parent 4b2c9ab commit 6a8dbf0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lua/gitsigns/git/blame.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ function M.run_blame(obj, contents, lnum, revision, opts)
239239
return ret, {}
240240
end
241241

242+
--- @type Gitsigns.BlameOpts
243+
--- EmmyLuaLs/emmylua-analyzer-rust#921
242244
opts = opts or {}
243245

244246
local ignore_file = obj.repo.toplevel .. '/.git-blame-ignore-revs'
@@ -261,7 +263,7 @@ function M.run_blame(obj, contents, lnum, revision, opts)
261263
'blame',
262264
'--incremental',
263265
contents and { '--contents', '-' },
264-
opts.ignore_whitespace and '-w',
266+
opts.ignore_whitespace and '-w' or nil,
265267
lnum and { '-L', type(lnum) == 'table' and (lnum[1] .. ',' .. lnum[2]) or (lnum .. ',+1') },
266268
opts.extra_opts,
267269
uv.fs_stat(ignore_file) and { '--ignore-revs-file', ignore_file },

lua/gitsigns/util.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,10 @@ function M.flatten(x)
456456
vim.list_extend(ret, M.flatten(v))
457457
elseif type(v) == 'string' then
458458
ret[#ret + 1] = v
459-
elseif v == nil then
459+
elseif not v then
460460
-- skip
461461
else
462-
error('Expected string or table, got ' .. type(v))
462+
error('Expected string, table, false or nil, got ' .. type(v))
463463
end
464464
end
465465
return ret

0 commit comments

Comments
 (0)