feat(git): show diff stats when there's no branch

For example, it can show stats for yadm managed files.
This commit is contained in:
Yufan You
2021-05-04 01:12:26 +08:00
committed by Olivier Roques
parent c9209c583b
commit bbd48eaaef

View File

@@ -45,7 +45,11 @@ end
local function get_item()
local hunks, branch = get_hunks(), get_branch()
if branch == '' then
return ''
if hunks == '+0 ~0 -0' then
return ''
else
return hunks
end
end
branch = not branch and '' or ' ' .. branch
return table.concat({hunks, branch})