Skip to content

Commit

Permalink
fix(push): fix padding in post-push notification
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Nov 7, 2024
1 parent 6073662 commit 31890c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/tinygit/commands/push-pull.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ local function pushCmd(opts)

-- notify
if result.code == 0 then
local numOfPushedCommits = u.syncShellCmd { "git", "rev-list", "--count", commitRange }
local numOfPushedCommits = u.syncShellCmd({ "git", "rev-list", "--count", commitRange })
:gsub("\n +", "\n") -- remove leading spaces
if numOfPushedCommits ~= "" then
local plural = numOfPushedCommits ~= "1" and "s" or ""
out = out .. (" (%s commit%s)"):format(numOfPushedCommits, plural)
out = out .. ("\n(%s commit%s)"):format(numOfPushedCommits, plural)
end
end
u.notify(out, result.code == 0 and "info" or "error", "Push")
Expand Down

0 comments on commit 31890c8

Please sign in to comment.