Skip to content

Reject blank environment variables in Gitlab::Git::RevList

Rémy Coutable requested to merge 25848-fix-git-rev-list-env-parsing into master

What does this MR do?

This MR rejects blank environment variables passed to Gitlab::Git::RevList and cast their value to String before checking #start_with?, just in case.

Are there points in the code the reviewer needs to double check?

I think this is correct to reject nil and "" variables, but a double check would be appreciated.

Why was this MR needed?

Because push are broken otherwise (unless you use Git 2.11 I think). For instance it's currently broken on dev:

› git push
Counting objects: 3, done.
Writing objects: 100% (3/3), 670 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: GitLab: API is not accessible
To dev.gitlab.org:remy/wiki-test.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@dev.gitlab.org:remy/wiki-test.git'

Closes #25848 (closed)

Merge request reports