From 1ac32de8bfe0d8aaeb7c0ae16182018f842effbf Mon Sep 17 00:00:00 2001 From: Matthew Champagne Date: Sat, 28 Jun 2025 16:51:14 -0400 Subject: [PATCH] Fixed getting git info for projects with space in path --- lua/projectmgr/helpers.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/projectmgr/helpers.lua b/lua/projectmgr/helpers.lua index 7217bc9..035eb3c 100644 --- a/lua/projectmgr/helpers.lua +++ b/lua/projectmgr/helpers.lua @@ -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 @@ -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)