Using `use_git_branch` in a non git enabled repo caused an error. This has been addressed by checking for the presence of a `.git` folder in the cwd. If no branch has been specified then we default to HEAD via the addition of `2>/dev/null` in our shell command
In further testing, it became clear that adding the global variables to the setup and start functions would be useful.
It also seemed to make sense to return boolean values to detect if Persistence has stopped (false) or is in active use (true).
In my statusline, I like to know if persistence.nvim is active. I have a simple helper function:
function using_session()
return (vim.g.using_persistance ~= nil)
end
which I reference and display a corresponding glyph
This creates session files like:
%Users%Oli%Code%Projects%persistance_feature%add-git-branch-to-session
enabling you to segment your project directory by git branch