Skip to content

Commit

Permalink
fix: get the repo version of the username
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Jul 3, 2024
1 parent d44a794 commit 4dd5d66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/gitsigns/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ M.Obj = Obj
--- @field abbrev_head string

--- @class Gitsigns.Repo : Gitsigns.RepoInfo
---
--- Username configured for the repo.
--- Needed for to determine "You" in current line blame.
--- @field username string
local Repo = {}
M.Repo = Repo
Expand Down Expand Up @@ -328,7 +331,6 @@ end
function Repo.new(dir, gitdir, toplevel)
local self = setmetatable({}, { __index = Repo })

self.username = git_command({ 'config', 'user.name' }, { ignore_error = true })[1]
local info = M.get_repo_info(dir, nil, gitdir, toplevel)
for k, v in
pairs(info --[[@as table<string,any>]])
Expand All @@ -337,6 +339,8 @@ function Repo.new(dir, gitdir, toplevel)
self[k] = v
end

self.username = self:command({ 'config', 'user.name' }, { ignore_error = true })[1]

return self
end

Expand Down

0 comments on commit 4dd5d66

Please sign in to comment.