chore(git): remove comments
This commit is contained in:
+1
-14
@@ -28,7 +28,7 @@ local ZERO_SHA = string.rep("0", 40)
|
|||||||
---@class ow.Git.Blame.BufState
|
---@class ow.Git.Blame.BufState
|
||||||
---@field repo ow.Git.Repo
|
---@field repo ow.Git.Repo
|
||||||
---@field rel string
|
---@field rel string
|
||||||
---@field revision string? nil = working tree, else the blamed revision
|
---@field revision string?
|
||||||
---@field commits table<string, ow.Git.Blame.Commit>
|
---@field commits table<string, ow.Git.Blame.Commit>
|
||||||
---@field line_sha table<integer, string>
|
---@field line_sha table<integer, string>
|
||||||
---@field tick integer?
|
---@field tick integer?
|
||||||
@@ -170,9 +170,6 @@ local function fetch_blame(r, rel, opts, done)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
---Work out what a buffer should be blamed against: a worktree file
|
|
||||||
---(blame the buffer contents) or a `git://<rev>:<path>` object (blame
|
|
||||||
---that revision). A `git://<rev>` object with no path is not blameable.
|
|
||||||
---@param buf integer
|
---@param buf integer
|
||||||
---@return ow.Git.Blame.Source?
|
---@return ow.Git.Blame.Source?
|
||||||
local function resolve_source(buf)
|
local function resolve_source(buf)
|
||||||
@@ -230,9 +227,6 @@ local function ensure_state(buf)
|
|||||||
return state
|
return state
|
||||||
end
|
end
|
||||||
|
|
||||||
---Blame the buffer and cache the result, keyed by `changedtick`. Worktree
|
|
||||||
---buffers blame the live buffer contents; `git://` buffers blame their
|
|
||||||
---revision. `done` runs once the cache is populated.
|
|
||||||
---@param state ow.Git.Blame.BufState
|
---@param state ow.Git.Blame.BufState
|
||||||
---@param buf integer
|
---@param buf integer
|
||||||
---@param done fun()?
|
---@param done fun()?
|
||||||
@@ -467,9 +461,6 @@ function M.line_popup(buf)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
---Blame the current line of the current buffer, then hand the commit to
|
|
||||||
---`done`. Works in worktree files and `git://<rev>:<path>` buffers
|
|
||||||
---alike, so the open-* actions chain through history.
|
|
||||||
---@param done fun(state: ow.Git.Blame.BufState, sha: string)
|
---@param done fun(state: ow.Git.Blame.BufState, sha: string)
|
||||||
local function blame_line(done)
|
local function blame_line(done)
|
||||||
local buf = vim.api.nvim_get_current_buf()
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
@@ -525,10 +516,6 @@ function M.detach(buf)
|
|||||||
states[buf] = nil
|
states[buf] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The blame cache is keyed by `changedtick`, which a commit / checkout /
|
|
||||||
-- rebase does not bump. Drop the cache for affected worktree buffers on a
|
|
||||||
-- repo change so the next popup re-fetches. `git://` buffers blame a
|
|
||||||
-- fixed revision and are skipped.
|
|
||||||
repo.on("change", function(r, change)
|
repo.on("change", function(r, change)
|
||||||
for _, state in pairs(states) do
|
for _, state in pairs(states) do
|
||||||
if
|
if
|
||||||
|
|||||||
Reference in New Issue
Block a user