Gitlab-Shell implementation of https://gitlab.com/gitlab-org/gitlab-ce/issues/29925
/cc @jacobvosmaer-gitlab