https://gitlab.com/gitlab-org/gitlab-ce/blob/657065b73eb7253d60c9a63c74a75c0f9c3085ca/lib/gitlab/git/repository.rb#L1106