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
|
end
|
||||||
vim.b[buf].git_index_mode = mode
|
vim.b[buf].git_index_mode = mode
|
||||||
end
|
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({
|
local upd = vim.system({
|
||||||
"git",
|
"git",
|
||||||
"update-index",
|
"update-index",
|
||||||
"--cacheinfo",
|
"--cacheinfo",
|
||||||
mode .. "," .. sha .. "," .. path,
|
mode,
|
||||||
|
sha,
|
||||||
|
path,
|
||||||
}, { cwd = worktree, text = true }):wait()
|
}, { cwd = worktree, text = true }):wait()
|
||||||
if upd.code ~= 0 then
|
if upd.code ~= 0 then
|
||||||
log.error("git update-index failed: %s", upd.stderr or "")
|
log.error("git update-index failed: %s", upd.stderr or "")
|
||||||
|
|||||||
Reference in New Issue
Block a user