CI_COMMIT_REF_SLUG variable don't contains expected branch name during MERGE REQUESTS

Summary

Durring merge-request, CI_COMMIT_REF_SLUG variable do not contains the branch name.
We've been using this value for the last 6months. The variable content changed durring the last 2weeks.

Steps to reproduce

create a job with only : [merge_requests]
Simply call a script with echo branch = $CI_COMMIT_REF_SLUG

Example Project

https://gitlab.com/gitlab-cd/sandbox/tree/invalid-ref-slug

What is the current bug behavior?

display a kind of merge request mnemonic "refs-branch-name-4-head"

What is the expected correct behavior?

should simply dispalay branch name "branch-name"

Relevant logs and/or screenshots

Checking out 2482279f as refs/merge-requests/4/head...

Skipping Git submodules setup
$ echo CI_COMMIT_REF_SLUG = $CI_COMMIT_REF_SLUG
CI_COMMIT_REF_SLUG = refs-merge-requests-4-head
Job succeeded

Output of checks

This bug happens on GitLab.com

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Edited Apr 29, 2019 by x4v13r
Assignee Loading
Time tracking Loading