fix(git/cmd): parse :G args with shell-style quoting

This commit is contained in:
2026-05-07 13:49:52 +02:00
parent 6d1fb8f7d3
commit b25a35dd8e
5 changed files with 200 additions and 28 deletions
+3 -4
View File
@@ -4,9 +4,8 @@ local util = require("git.util")
local M = {}
---@param opts { amend: boolean? }?
---@param opts { args: string[]? }?
function M.commit(opts)
local amend = opts and opts.amend or false
local r = repo.resolve()
if not r then
util.error("not in a git repository")
@@ -14,8 +13,8 @@ function M.commit(opts)
end
local cmd = { "git", "commit" }
if amend then
table.insert(cmd, "--amend")
if opts and opts.args then
vim.list_extend(cmd, opts.args)
end
local proxy_buf, proxy_win