Commit 4a4bd16b authored by Samantha Ming's avatar Samantha Ming

Fix incorrect path parsing when name ends with ref

Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/330947
parent 700e1ab5
......@@ -129,7 +129,7 @@ export default class Project {
const currentRef = $dropdown.data('ref');
// The split and startWith is to ensure an exact word match
// and avoid partial match ie. currentRef is "dev" and loc is "development"
const splitPathAfterRefPortion = loc.split(currentRef)[1];
const splitPathAfterRefPortion = loc.split('/-/')[1].split(currentRef)[1];
const doesPathContainRef = splitPathAfterRefPortion?.startsWith('/');
if (doesPathContainRef) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment