mirror of
https://github.com/folke/persistence.nvim.git
synced 2025-07-16 12:24:41 +02:00
fix: branch detection. Closes #62
This commit is contained in:
parent
34f337e383
commit
a1d37fa32e
1 changed files with 4 additions and 1 deletions
|
@ -120,7 +120,10 @@ end
|
|||
--- get current branch name
|
||||
---@return string?
|
||||
function M.branch()
|
||||
return vim.fn.systemlist("git branch --show-current")[1]
|
||||
if uv.fs_stat(".git") then
|
||||
local ret = vim.fn.systemlist("git branch --show-current")[1]
|
||||
return vim.v.shell_error == 0 and ret or nil
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue