mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
feat(picker.git): allow passing extra args to git log command for file renames (#1964)
Some checks are pending
CI / ci (push) Waiting to run
Some checks are pending
CI / ci (push) Waiting to run
## Description Allows passing extra Git arguments (like `--git-dir` or `--work-tree`) to the rename detection logic inside `M.log` in `picker/source/git.lua`. Previously, these extra arguments from `opts.args` were applied to the main `git log` command but ignored during rename detection. This caused errors or incorrect results when working in non-standard repo setups. This change uses `git_args(...)` to build the rename detection command, ensuring consistent argument handling throughout `M.log`.
This commit is contained in:
parent
d31f50f0a7
commit
2aee35d059
1 changed files with 11 additions and 1 deletions
|
|
@ -137,7 +137,17 @@ function M.log(opts, ctx)
|
|||
Proc.proc({
|
||||
cmd = "git",
|
||||
cwd = cwd,
|
||||
args = { "log", "-z", "--follow", "--name-status", "--pretty=format:''", "--diff-filter=R", "--", file },
|
||||
args = git_args(
|
||||
opts.args,
|
||||
"log",
|
||||
"-z",
|
||||
"--follow",
|
||||
"--name-status",
|
||||
"--pretty=format:''",
|
||||
"--diff-filter=R",
|
||||
"--",
|
||||
file
|
||||
),
|
||||
}, ctx)(function(item)
|
||||
for _, text in ipairs(vim.split(item.text, "\0")) do
|
||||
if text:find("^R%d%d%d$") then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue