Skip to content

Commit

Permalink
Only ask for confirmation if an upstream is set for the branch
Browse files Browse the repository at this point in the history
  • Loading branch information
CKolkey committed Jul 27, 2023
1 parent 604be39 commit 58c4230
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/neogit/popups/commit/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ local a = require("plenary.async")

local function confirm_modifications()
if
#git.repo.unmerged.items < 1
git.branch.upstream()
and #git.repo.unmerged.items < 1
and not input.get_confirmation(
string.format(
"This commit has already been published to %s, do you really want to modify it?",
git.repo.upstream.ref
git.branch.upstream()
),
{ values = { "&Yes", "&No" }, default = 2 }
)
Expand Down

0 comments on commit 58c4230

Please sign in to comment.