Commit 5eb8b531 authored by Simon Knox's avatar Simon Knox

Merge branch '330947-incorrect-ref-commit' into 'master'

Fix incorrect path parsing when name ends with ref

See merge request gitlab-org/gitlab!62101
parents b1b22c6b 4a4bd16b
......@@ -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