Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-05 00:07:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-05 00:07:26 +0300
commit2242221252d13fdf322b5e59f971a689831c541b (patch)
tree23e30706b58811d2dd2522853cb3bbc27bab028d /app/assets/javascripts/repository
parent9c66c38ab6ce56cfe06eca21f717977f1684f08c (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.js3
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,
);