mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(git): set diff.noprefix=false for git diff to ensure correct format (#2174)
## Description Parsing the output of git diff here depends on its exact format. The user environment might be set up with diff.noprefix, in which case the parsing fails, because the `a/` and `b/` prefixes for the paths is missing. Passing `-c diff.noprefix=false` to the call overrides this. <!-- Describe the big picture of your changes to communicate to the maintainers why we should accept this pull request. --> ## Related Issue(s) <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots <!-- Add screenshots of the changes if applicable. -->
This commit is contained in:
parent
f5ff06330e
commit
93f43ca10f
1 changed files with 3 additions and 1 deletions
|
|
@ -212,7 +212,9 @@ end
|
|||
---@param opts snacks.picker.git.Config
|
||||
---@type snacks.picker.finder
|
||||
function M.diff(opts, ctx)
|
||||
local args = git_args(opts.args, "--no-pager", "diff", "--no-color", "--no-ext-diff")
|
||||
local args = git_args(opts.args,
|
||||
"-c", "diff.noprefix=false",
|
||||
"--no-pager", "diff", "--no-color", "--no-ext-diff")
|
||||
local file, line ---@type string?, number?
|
||||
local header, hunk = {}, {} ---@type string[], string[]
|
||||
local header_len = 4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue