mirror of
https://github.com/lewis6991/gitsigns.nvim
synced 2025-02-16 04:06:50 +00:00
parent
9113de1ed5
commit
36184e5a58
@ -749,7 +749,7 @@ end
|
||||
local _current_line_blame = void_async(function()
|
||||
local bufnr = current_buf()
|
||||
local bcache = cache[bufnr]
|
||||
if not bcache then
|
||||
if not bcache or not bcache.object_name then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -195,6 +195,10 @@ M.run_blame = a.wrap(function(
|
||||
end,
|
||||
on_exit = function()
|
||||
local ret = {}
|
||||
if #results == 0 then
|
||||
callback({})
|
||||
return
|
||||
end
|
||||
local header = vim.split(table.remove(results, 1), ' ')
|
||||
ret.sha = header[1]
|
||||
ret.abbrev_sha = string.sub(ret.sha, 1, 8)
|
||||
|
@ -749,7 +749,7 @@ end
|
||||
local _current_line_blame = void_async(function()
|
||||
local bufnr = current_buf()
|
||||
local bcache = cache[bufnr]
|
||||
if not bcache then
|
||||
if not bcache or not bcache.object_name then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -195,6 +195,10 @@ M.run_blame = a.wrap(function(
|
||||
end,
|
||||
on_exit = function()
|
||||
local ret: {string:any} = {}
|
||||
if #results == 0 then
|
||||
callback({})
|
||||
return
|
||||
end
|
||||
local header = vim.split(table.remove(results, 1), ' ')
|
||||
ret.sha = header[1]
|
||||
ret.abbrev_sha = string.sub(ret.sha as string, 1, 8)
|
||||
|
@ -436,6 +436,22 @@ describe('gitsigns', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('current line blame', function()
|
||||
it('doesn\'t error on untracked files', function()
|
||||
command("set updatetime=1")
|
||||
init(true)
|
||||
screen:detach()
|
||||
screen:attach({ext_messages=true})
|
||||
config.current_line_blame = true
|
||||
exec_lua('gs.setup(...)', config)
|
||||
sleep(20)
|
||||
edit(newfile)
|
||||
feed("iline<esc>")
|
||||
command("write")
|
||||
screen:expect{messages = { { content = { { "<" } }, kind = "" } } }
|
||||
end)
|
||||
end)
|
||||
|
||||
local function testsuite(advanced_features)
|
||||
return function()
|
||||
before_each(function()
|
||||
|
Loading…
Reference in New Issue
Block a user