diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 03:09:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 03:09:04 +0300 |
commit | 27a18afc7dba4e09a5ec78e5c251c31216d7792a (patch) | |
tree | 5dcc015be79e00de4133a66defe10bf1463ff827 /spec/lib/gitlab/git | |
parent | 71c9d577ad563572050335dc261ba7673e3e566f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/git')
-rw-r--r-- | spec/lib/gitlab/git/conflict/parser_spec.rb | 148 |
1 files changed, 74 insertions, 74 deletions
diff --git a/spec/lib/gitlab/git/conflict/parser_spec.rb b/spec/lib/gitlab/git/conflict/parser_spec.rb index 600c870acd4..92ea44394b1 100644 --- a/spec/lib/gitlab/git/conflict/parser_spec.rb +++ b/spec/lib/gitlab/git/conflict/parser_spec.rb @@ -10,80 +10,80 @@ describe Gitlab::Git::Conflict::Parser do context 'when the file has valid conflicts' do let(:text) do - <<CONFLICT -module Gitlab - module Regexp - extend self - - def username_regexp - default_regexp - end - -<<<<<<< files/ruby/regex.rb - def project_name_regexp - /\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z/ - end - - def name_regexp - /\A[a-zA-Z0-9_\-\. ]*\z/ -======= - def project_name_regex - %r{\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z} - end - - def name_regex - %r{\A[a-zA-Z0-9_\-\. ]*\z} ->>>>>>> files/ruby/regex.rb - end - - def path_regexp - default_regexp - end - -<<<<<<< files/ruby/regex.rb - def archive_formats_regexp - /(zip|tar|7z|tar\.gz|tgz|gz|tar\.bz2|tbz|tbz2|tb2|bz2)/ -======= - def archive_formats_regex - %r{(zip|tar|7z|tar\.gz|tgz|gz|tar\.bz2|tbz|tbz2|tb2|bz2)} ->>>>>>> files/ruby/regex.rb - end - - def git_reference_regexp - # Valid git ref regexp, see: - # https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html - %r{ - (?! - (?# doesn't begins with) - \/| (?# rule #6) - (?# doesn't contain) - .*(?: - [\/.]\.| (?# rule #1,3) - \/\/| (?# rule #6) - @\{| (?# rule #8) - \\ (?# rule #9) - ) - ) - [^\000-\040\177~^:?*\[]+ (?# rule #4-5) - (?# doesn't end with) - (?<!\.lock) (?# rule #1) - (?<![\/.]) (?# rule #6-7) - }x - end - - protected - -<<<<<<< files/ruby/regex.rb - def default_regexp - /\A[.?]?[a-zA-Z0-9][a-zA-Z0-9_\-\.]*(?<!\.git)\z/ -======= - def default_regex - %r{\A[.?]?[a-zA-Z0-9][a-zA-Z0-9_\-\.]*(?<!\.git)\z} ->>>>>>> files/ruby/regex.rb - end - end -end -CONFLICT + <<~CONFLICT + module Gitlab + module Regexp + extend self + + def username_regexp + default_regexp + end + + <<<<<<< files/ruby/regex.rb + def project_name_regexp + /\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z/ + end + + def name_regexp + /\A[a-zA-Z0-9_\-\. ]*\z/ + ======= + def project_name_regex + %r{\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z} + end + + def name_regex + %r{\A[a-zA-Z0-9_\-\. ]*\z} + >>>>>>> files/ruby/regex.rb + end + + def path_regexp + default_regexp + end + + <<<<<<< files/ruby/regex.rb + def archive_formats_regexp + /(zip|tar|7z|tar\.gz|tgz|gz|tar\.bz2|tbz|tbz2|tb2|bz2)/ + ======= + def archive_formats_regex + %r{(zip|tar|7z|tar\.gz|tgz|gz|tar\.bz2|tbz|tbz2|tb2|bz2)} + >>>>>>> files/ruby/regex.rb + end + + def git_reference_regexp + # Valid git ref regexp, see: + # https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html + %r{ + (?! + (?# doesn't begins with) + \/| (?# rule #6) + (?# doesn't contain) + .*(?: + [\/.]\.| (?# rule #1,3) + \/\/| (?# rule #6) + @\{| (?# rule #8) + \\ (?# rule #9) + ) + ) + [^\000-\040\177~^:?*\[]+ (?# rule #4-5) + (?# doesn't end with) + (?<!\.lock) (?# rule #1) + (?<![\/.]) (?# rule #6-7) + }x + end + + protected + + <<<<<<< files/ruby/regex.rb + def default_regexp + /\A[.?]?[a-zA-Z0-9][a-zA-Z0-9_\-\.]*(?<!\.git)\z/ + ======= + def default_regex + %r{\A[.?]?[a-zA-Z0-9][a-zA-Z0-9_\-\.]*(?<!\.git)\z} + >>>>>>> files/ruby/regex.rb + end + end + end + CONFLICT end let(:lines) do |