Added hash mark uri encoding for branch name

This commit is contained in:
Masahiro Kasashima 2023-05-25 22:12:16 +09:00
parent 374c081409
commit 9437ab08c5

View file

@ -77,6 +77,7 @@ end
-- Returns the current branch or commit if they are available on remote -- Returns the current branch or commit if they are available on remote
-- otherwise this will return the default branch of the repo -- otherwise this will return the default branch of the repo
function M.get_current_branch_or_commit() function M.get_current_branch_or_commit()
local core = function()
local current_branch = get_current_branch() local current_branch = get_current_branch()
if current_branch ~= "HEAD" and M.is_branch_upstreamed(current_branch) then if current_branch ~= "HEAD" and M.is_branch_upstreamed(current_branch) then
return current_branch return current_branch
@ -90,6 +91,9 @@ function M.get_current_branch_or_commit()
return M.get_default_branch() return M.get_default_branch()
end end
return string.gsub(core(), "#", "%%23")
end
-- get the active buf relative file path form the .git -- get the active buf relative file path form the .git
function M.get_current_relative_file_path() function M.get_current_relative_file_path()
-- we only want the active buffer name -- we only want the active buffer name