Skip to content

Commit

Permalink
refactor: var names
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Sep 27, 2023
1 parent 104b93e commit 18864a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/tinygit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -262,19 +262,19 @@ function M.smartCommit(opts, prefillMsg)
setGitCommitAppearance()
vim.ui.input({ prompt = "󰊢 Commit Message", default = prefillMsg }, function(commitMsg)
if not commitMsg then return end -- aborted input modal
local validMsg, newMsg = processCommitMsg(commitMsg)
local validMsg, processedMsg = processCommitMsg(commitMsg)
if not validMsg then -- if msg invalid, run again to fix the msg
M.smartCommit(opts, newMsg)
M.smartCommit(opts, processedMsg)
return
end

local stageInfo = stageAllIfNoChanges()
if not stageInfo then return end

local stderr = fn.system { "git", "commit", "-m", newMsg }
local stderr = fn.system { "git", "commit", "-m", processedMsg }
if nonZeroExit(stderr) then return end

local body = { stageInfo, ('"%s"'):format(newMsg) }
local body = { stageInfo, ('"%s"'):format(processedMsg) }
if opts.push then table.insert(body, "Pushing…") end
local notifyText = table.concat(body, "\n" .. notifySeperator .. "\n")
notify(notifyText, "info", "Smart-Commit")
Expand Down

0 comments on commit 18864a8

Please sign in to comment.