Skip to content

Commit b7591b8

Browse files
committed
fix(push): issues opened when pushing while everything is up-to-date
1 parent ac211b1 commit b7591b8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lua/tinygit/commands/push-pull.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ local createGitHubPr = require("tinygit.commands.github").createGitHubPr
55
local updateStatusline = require("tinygit.statusline").updateAllComponents
66
--------------------------------------------------------------------------------
77

8-
---@param commitRange string
8+
---@param commitRange string|nil
99
local function openReferencedIssues(commitRange)
10+
if not commitRange then return end -- e.g. for "Everything is up-to-date"
1011
local repo = require("tinygit.commands.github").getGithubRemote("silent")
1112
if not repo then return end
1213

@@ -33,7 +34,7 @@ local function pushCmd(opts)
3334
vim.schedule_wrap(function(result)
3435
local out = vim.trim((result.stdout or "") .. (result.stderr or ""))
3536
out = out:gsub("\n%s+", "\n") -- remove padding
36-
local commitRange = out:match("%x+%.%.%x+")
37+
local commitRange = out:match("%x+%.%.%x+") ---@type string|nil
3738
-- force-push `+` would get md-lhighlight
3839
local ft = opts.forceWithLease and "text" or "markdown"
3940

0 commit comments

Comments
 (0)