From d67484fe87d423ace0b0f7b4590a80f8bfc8cee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20F=2E=20Bortl=C3=ADk?= Date: Sat, 28 Feb 2026 07:44:58 +0100 Subject: [PATCH] fix: check local branch up-to-date on remote before creating comment --- lua/gitlab/actions/comment.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/gitlab/actions/comment.lua b/lua/gitlab/actions/comment.lua index 03202a2..086cd1e 100644 --- a/lua/gitlab/actions/comment.lua +++ b/lua/gitlab/actions/comment.lua @@ -349,6 +349,10 @@ M.can_create_comment = function(must_be_visual) return false end + if not git.check_current_branch_up_to_date_on_remote(vim.log.levels.ERROR) then + return false + end + -- Check we're in visual mode for code suggestions and multiline comments if must_be_visual and not u.check_visual_mode() then return false