diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-17 12:02:50 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-17 12:02:50 +0000 |
commit | d68c23a00e752d347c2439541fe4dddd602ddbcc (patch) | |
tree | fd714da5a3b38567fd514c81dc9a08a31982cc54 /lib | |
parent | 5ae6d1f8568cf87637ee9d55c77efa76a765118d (diff) | |
parent | 7a399b7061d4d374f01ddaa75ae7fba53ca4cb6b (diff) | |
download | gitlab-ce-d68c23a00e752d347c2439541fe4dddd602ddbcc.tar.gz |
Merge branch '26470-branch-names-with-reference-prefixes-results-in-buggy-branches' into 'master'
Strip reference prefixes on branch creation
Closes #26470
See merge request !8498
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git_ref_validator.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/git_ref_validator.rb b/lib/gitlab/git_ref_validator.rb index 4d83d8e72a8..0e87ee30c98 100644 --- a/lib/gitlab/git_ref_validator.rb +++ b/lib/gitlab/git_ref_validator.rb @@ -5,6 +5,9 @@ module Gitlab # # Returns true for a valid reference name, false otherwise def validate(ref_name) + return false if ref_name.start_with?('refs/heads/') + return false if ref_name.start_with?('refs/remotes/') + Gitlab::Utils.system_silent( %W(#{Gitlab.config.git.bin_path} check-ref-format refs/#{ref_name})) end |