fix(git): use 3-arg --cacheinfo to survive commas in paths
This commit is contained in:
+6
-1
@@ -39,11 +39,16 @@ local function attach_index_writer(buf, worktree, path)
|
||||
end
|
||||
vim.b[buf].git_index_mode = mode
|
||||
end
|
||||
-- Use the 3-arg form (mode sha path) instead of the comma form
|
||||
-- (mode,sha,path), which doesn't survive paths containing a
|
||||
-- comma.
|
||||
local upd = vim.system({
|
||||
"git",
|
||||
"update-index",
|
||||
"--cacheinfo",
|
||||
mode .. "," .. sha .. "," .. path,
|
||||
mode,
|
||||
sha,
|
||||
path,
|
||||
}, { cwd = worktree, text = true }):wait()
|
||||
if upd.code ~= 0 then
|
||||
log.error("git update-index failed: %s", upd.stderr or "")
|
||||
|
||||
Reference in New Issue
Block a user