diff --git a/CHANGELOG.md b/CHANGELOG.md index ac98d236..4d0a60a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Deletion of files in locked environment is now suppressed (#302) - Failed to import file VS Code popup no longer shows up after overwriting file on server once (#264) - Don't automatically stage files added to source control (#303) +- Checkout of branches whose names contain slashes via Web UI no longer fails (#295) ## [2.3.0] - 2023-12-06 diff --git a/git-webui/release/share/git-webui/webui/js/git-webui.js b/git-webui/release/share/git-webui/webui/js/git-webui.js index 860c1a60..3dbc6ad8 100644 --- a/git-webui/release/share/git-webui/webui/js/git-webui.js +++ b/git-webui/release/share/git-webui/webui/js/git-webui.js @@ -323,7 +323,7 @@ webui.SideBarView = function(mainView, noEventHandlers) { var cardDiv = $('
').appendTo(accordionDiv)[0]; if (id.indexOf("local-branches") > -1) { // parses the output of git branch --verbose --verbose - var matches = /^\*?\s*([\w-]+)\s+([^\s]+)\s+(\[.*\])?.*/.exec(ref); + var matches = /^\*?\s*([\w-\/]+)\s+([^\s]+)\s+(\[.*\])?.*/.exec(ref); var branchInfo = { "branch_name": matches[1], "hash": matches[2], @@ -331,7 +331,7 @@ webui.SideBarView = function(mainView, noEventHandlers) { } var refname = branchInfo.branch_name; var canPush = (branchInfo.remote === undefined) || (branchInfo.remote.indexOf("ahead") > -1) // either no upstream or ahead of upstream - var itemId = refname + idPostfix; + var itemId = refname.replaceAll('/', '-') + idPostfix; var cardHeader = $('
').appendTo(cardDiv); var button = $('