Skip to content

Commit

Permalink
fix(smartCommit): detection of clean commits
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Oct 27, 2023
1 parent fe098fc commit 5f89e73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/tinygit/commit-and-amend.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ end
---@return boolean
local function hasNoUnstagedChanges()
fn.system { "git", "diff", "--quiet" }
local hasNoUnstaged = vim.v.shell_error ~= 0
-- SIC yes, in this case the meaning of the exit codes 1 and 0 is indeed
-- switched as compared to `--staged`, for whatever reason. Thus, the exit
-- code 0 means *no* changes here.
local hasNoUnstaged = vim.v.shell_error == 0
return hasNoUnstaged
end

Expand Down

0 comments on commit 5f89e73

Please sign in to comment.