diff options
author | kylo252 <[email protected]> | 2022-04-20 13:27:51 +0200 |
---|---|---|
committer | kylo252 <[email protected]> | 2022-04-20 13:27:51 +0200 |
commit | ce4f7b0fc82dcc0ec604cd7b576ae5db95ab7235 (patch) | |
tree | 0dbea71a10ac2f3c5e1e2ba21e8d132fa0199f3a /lua/lvim/utils/git.lua | |
parent | 2567d8612e2f31c024038e54b3dfa4825ff539d6 (diff) | |
parent | 0481ec8dddf4bd8ed81c10ae98807fec97f6f872 (diff) |
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lvim/utils/git.lua')
-rw-r--r-- | lua/lvim/utils/git.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lua/lvim/utils/git.lua b/lua/lvim/utils/git.lua index 9848835e..f38a727f 100644 --- a/lua/lvim/utils/git.lua +++ b/lua/lvim/utils/git.lua @@ -72,6 +72,8 @@ function M.update_base_lvim() Log:error "Update failed! Please pull the changes manually instead." return end + + return true end ---Switch Lunarvim to the specified development branch @@ -80,11 +82,19 @@ function M.switch_lvim_branch(branch) if not safe_deep_fetch() then return end - local ret = git_cmd { args = { "switch", branch } } + local args = { "switch", branch } + + if branch:match "^[0-9]" then + -- avoids producing an error for tags + vim.list_extend(args, { "--detach" }) + end + + local ret = git_cmd { args = args } if ret ~= 0 then Log:error "Unable to switch branches! Check the log for further information" return end + return true end ---Get the current Lunarvim development branch |