diff --git a/lua/aw_watcher/utils.lua b/lua/aw_watcher/utils.lua index a0cd746..7f42ef4 100644 --- a/lua/aw_watcher/utils.lua +++ b/lua/aw_watcher/utils.lua @@ -19,7 +19,7 @@ local function set_project_name() end local function set_branch_name() - local branch = vim.fn.system("git rev-parse --abbrev-ref HEAD") + local branch = vim.fn.system("git rev-parse --abbrev-ref HEAD 2>/dev/null"):gsub("\n", "") vim.b.branch_name = branch == "" and "unknown" or branch return vim.b.branch_name end