diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-05 00:07:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-05 00:07:26 +0300 |
commit | 2242221252d13fdf322b5e59f971a689831c541b (patch) | |
tree | 23e30706b58811d2dd2522853cb3bbc27bab028d /app/assets/javascripts/repository | |
parent | 9c66c38ab6ce56cfe06eca21f717977f1684f08c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
-rw-r--r-- | app/assets/javascripts/repository/utils/ref_switcher_utils.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/repository/utils/ref_switcher_utils.js b/app/assets/javascripts/repository/utils/ref_switcher_utils.js index ceb80d85f74..f296b5e9b4a 100644 --- a/app/assets/javascripts/repository/utils/ref_switcher_utils.js +++ b/app/assets/javascripts/repository/utils/ref_switcher_utils.js @@ -17,6 +17,7 @@ const NAMESPACE_TARGET_REGEX = /(\/-\/(blob|tree))\/.*?\/(.*)/; */ export function generateRefDestinationPath(projectRootPath, selectedRef) { const currentPath = window.location.pathname; + const encodedHash = '%23'; let namespace = '/-/tree'; let target; const match = NAMESPACE_TARGET_REGEX.exec(currentPath); @@ -27,7 +28,7 @@ export function generateRefDestinationPath(projectRootPath, selectedRef) { const destinationPath = joinPaths( projectRootPath, namespace, - encodeURIComponent(selectedRef), + encodeURI(selectedRef).replace(/#/g, encodedHash), target, ); |