Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lua/projectmgr/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ end
function M.check_git(path)
local is_git = false
local handle =
io.popen("git -C " .. M.remove_trailing_slash(path) .. " rev-parse --is-inside-work-tree 2>/dev/null")
io.popen("git -C '" .. M.remove_trailing_slash(path) .. "' rev-parse --is-inside-work-tree 2>/dev/null")
if handle ~= nil then
local check_result = handle:read("*a")
if string.find(check_result, "true") then
Expand Down Expand Up @@ -98,11 +98,11 @@ function M.git_info(path)
return "✗", "✗", "✗"
end
local current_branch =
M.call_ext("git -C " .. M.remove_trailing_slash(path) .. "/.git rev-parse --abbrev-ref HEAD 2>/dev/null")
M.call_ext("git -C '" .. M.remove_trailing_slash(path) .. "/.git' rev-parse --abbrev-ref HEAD 2>/dev/null")
local tracking_branch = M.call_ext(
"git -C "
"git -C '"
.. M.remove_trailing_slash(path)
.. "/.git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null"
.. "/.git' rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null"
)

return M.symbolize(current_branch), M.symbolize(tracking_branch)
Expand Down