diff --git a/CHANGELOG.md b/CHANGELOG.md index a2738c26..5f8209cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Pulling add/delete of multiple non-IRIS files no longer causes error (#273) - Fixed -2 timestamp for some items (#275) - Reset SourceControlClass during module uninstall to prevent "Class does not exist error" (#285) +- Unreleased bug breaking Git WebUI from Studio (#297) ## [2.2.0] - 2023-06-05 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 9f77c604..9b67eaf9 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,9 +323,14 @@ 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 branchInfo = /^\*?\s*(?[\w-]+)\s+(?[^\s]+)\s+(?\[.*\])?.*/.exec(ref).groups; + var matches = /^\*?\s*([\w-]+)\s+([^\s]+)\s+(\[.*\])?.*/.exec(ref); + var branchInfo = { + "branch_name": matches[1], + "hash": matches[2], + "remote": matches[3] + } var refname = branchInfo.branch_name; - var canPush = (branchInfo.remote === undefined) || (branchInfo.remote.includes("ahead")) // either no upstream or ahead of upstream + var canPush = (branchInfo.remote === undefined) || (branchInfo.remote.indexOf("ahead") > -1) // either no upstream or ahead of upstream var itemId = refname + idPostfix; var cardHeader = $('
').appendTo(cardDiv); var button = $('