Skip to content

Commit

Permalink
feat(git): supply git -c config args with git_config
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Jul 10, 2023
1 parent ea4c5e9 commit 63bfdd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lua/fzf-lua/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,13 @@ function M.git_cwd(cmd, opts)
{ "cwd", "-C" },
{ "git_dir", "--git-dir" },
{ "git_worktree", "--work-tree" },
{ "git_config", "-c", noexpand = true },
}
if type(cmd) == "string" then
local args = ""
for _, a in ipairs(git_args) do
if o[a[1]] then
o[a[1]] = vim.fn.expand(o[a[1]])
o[a[1]] = a.noexpand and o[a[1]] or vim.fn.expand(o[a[1]])
args = args .. ("%s %s "):format(a[2], vim.fn.shellescape(o[a[1]]))
end
end
Expand All @@ -330,7 +331,7 @@ function M.git_cwd(cmd, opts)
cmd = utils.tbl_deep_clone(cmd)
for _, a in ipairs(git_args) do
if o[a[1]] then
o[a[1]] = vim.fn.expand(o[a[1]])
o[a[1]] = a.noexpand and o[a[1]] or vim.fn.expand(o[a[1]])
table.insert(cmd, idx, a[2])
table.insert(cmd, idx + 1, o[a[1]])
idx = idx + 2
Expand Down
1 change: 0 additions & 1 deletion lua/fzf-lua/providers/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ local core = require "fzf-lua.core"
local path = require "fzf-lua.path"
local utils = require "fzf-lua.utils"
local config = require "fzf-lua.config"
local libuv = require "fzf-lua.libuv"
local shell = require "fzf-lua.shell"
local make_entry = require "fzf-lua.make_entry"

Expand Down

0 comments on commit 63bfdd5

Please sign in to comment.