summaryrefslogtreecommitdiff
path: root/lib/gitlab/git_ref_validator.rb
Commit message (Collapse)AuthorAgeFilesLines
* Validate MR branch namesMark Chao2019-05-031-2/+21
| | | | | | | | | | Prevents refspec as branch name, which would bypass branch protection when used in conjunction with rebase. HEAD seems to be a special case with lots of occurrence, so it is considered valid for now. Another special case is `refs/head/*`, which can be imported.
* Gracefully handle references with null bytesStan Hu2018-11-261-1/+5
| | | | | | | | | | | | | | `Rugged::Reference.valid_name?` used in `Gitlab::GitRefValidator.validate` fails on strings containing null bytes because it uses `StringValueCStr()`. Per https://silverhammermba.github.io/emberb/c/: Ruby’s String kinda corresponds to C’s char*. The simplest macro is StringValueCStr() which returns a null-terminated char* for a String. The problem here is that a Ruby String might contain nulls - in which case StringValueCStr() will raise an ArgumentError! Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54466
* Enable frozen string for lib/gitlab/*.rbgfyoung2018-10-221-0/+2
|
* Use rugged to validate ref nameAhmad Hassan2018-07-191-4/+4
|
* Prevent branches or tags from starting with invalid characters (e.g. -, .)valid-branch-name-dash-bugJacob Schatz2017-10-051-1/+1
| | | | Closes #38817
* More Gitaly annotationsJacob Vosmaer2017-07-131-0/+2
|
* Strip reference prefixes on branch creationMatthieu Tardy2017-01-091-0/+3
| | | | Signed-off-by: Matthieu Tardy <matthieu.tardy@gmail.com>
* Replace all usages of `git` command with configurable binary pathrs-git-bin-pathRobert Speicher2015-11-031-1/+1
| | | | Closes #3311
* fix system silent callValery Sizov2014-11-061-1/+1
|
* Revert "Revert "Don't output to stdout from lib non-interactive methods""Valery Sizov2014-11-061-1/+2
| | | | This reverts commit b33d4bc2f1d26ee3526b9d7f530f468a9d5b5a5e.
* Revert "Don't output to stdout from lib non-interactive methods"Valery Sizov2014-11-061-2/+1
| | | | This reverts commit 0b1084a4538bc46684c8620410988d3b1093e7ab.
* Don't output to stdout from lib non-interactive methodsCiro Santilli2014-11-051-1/+2
| | | | It pollutes the test output too much.
* Validate branch-names and references in WebUI, APIRobert Schilling2014-09-031-0/+11
Add specs for GitRefValidator