From 99c3448c4102eab0ccf80829ecbeb96225dc8a53 Mon Sep 17 00:00:00 2001 From: Pravin Barton <9560941+isc-pbarton@users.noreply.github.com> Date: Tue, 14 Apr 2026 11:52:17 -0400 Subject: [PATCH 1/3] fix: display of branch names with special characters --- CHANGELOG.md | 1 + git-webui/release/share/git-webui/webui/js/git-webui.js | 8 ++++---- git-webui/src/share/git-webui/webui/js/git-webui.js | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4d1020b..58538049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Changes to % routines mapped to the current namespace may now be added to source control and committed (#944) - Edits to a decomposed production in VS Code fixed after changes to the VS Code ObjectScript extension (#949) +- Branch names containing special characters (e.g. `#`) now display correctly in the Git Web UI (#914) ## [2.16.0] - 2026-03-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 fe51b83a..1de2b488 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 @@ -439,7 +439,7 @@ webui.SideBarView = function(mainView, noEventHandlers) { searchBar.onkeyup = function(){ let branchCards = accordionDiv.getElementsByClassName("branch-card"); - var filter = searchBar.value.toUpperCase().replaceAll('/', '-'); + var filter = searchBar.value.toUpperCase().replaceAll('/', '-').replaceAll('#', '_'); for (let i = 0; i < branchCards.length; i++) { let card = branchCards[i] @@ -469,7 +469,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); if (!matches) { continue; } @@ -480,7 +480,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.replaceAll('/', '-') + idPostfix; + var itemId = refname.replaceAll('/', '-').replaceAll('#', '_') + idPostfix; var cardHeader = $('
').appendTo(cardDiv); var button = $('