mirror of
https://github.com/folke/persistence.nvim.git
synced 2025-07-17 17:23:29 +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
|
--- get current branch name
|
||||||
---@return string?
|
---@return string?
|
||||||
function M.branch()
|
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
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue