From 58c4230c9e324741816a2679f2b66bc5342ead1b Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 27 Jul 2023 12:27:43 +0200 Subject: [PATCH] Only ask for confirmation if an upstream is set for the branch --- lua/neogit/popups/commit/actions.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/neogit/popups/commit/actions.lua b/lua/neogit/popups/commit/actions.lua index 3e87befaf..74fc0195c 100644 --- a/lua/neogit/popups/commit/actions.lua +++ b/lua/neogit/popups/commit/actions.lua @@ -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 } )