diff --git a/lib/ohloh_scm/git/validation.rb b/lib/ohloh_scm/git/validation.rb index 24acf7b1..b616095a 100644 --- a/lib/ohloh_scm/git/validation.rb +++ b/lib/ohloh_scm/git/validation.rb @@ -3,11 +3,6 @@ module OhlohScm module Git class Validation < OhlohScm::Validation - def validate - super - @errors << [:branch_name, 'Invalid Branch Name.'] if scm.branch_name.to_s.empty? - end - private def validate_server_connection diff --git a/lib/ohloh_scm/validation.rb b/lib/ohloh_scm/validation.rb index f8597802..c644d5d9 100644 --- a/lib/ohloh_scm/validation.rb +++ b/lib/ohloh_scm/validation.rb @@ -22,16 +22,14 @@ def validate def validate_server_connection; end - # rubocop:disable Metrics/AbcSize def validate_attributes @errors = [] @errors << url_errors - @errors << branch_name_errors unless scm.branch_name.to_s.empty? + @errors << branch_name_errors @errors << username_errors if scm.username @errors << password_errors if scm.password @errors.compact! end - # rubocop:enable Metrics/AbcSize # rubocop:disable Metrics/AbcSize def url_errors @@ -48,7 +46,9 @@ def url_errors # rubocop:enable Metrics/AbcSize def branch_name_errors - if scm.branch_name.length > 80 + if scm.branch_name.to_s.empty? + [:branch_name, 'Invalid Branch Name.'] + elsif scm.branch_name.length > 80 [:branch_name, 'The branch name must not be longer than 80 characters.'] elsif !scm.branch_name.match?(/^[\w^\-\+\.\/\ ]+$/) [:branch_name, "The branch name may contain only letters, numbers, \ diff --git a/lib/ohloh_scm/version.rb b/lib/ohloh_scm/version.rb index af3c8913..bc9f97c8 100644 --- a/lib/ohloh_scm/version.rb +++ b/lib/ohloh_scm/version.rb @@ -2,7 +2,7 @@ module OhlohScm module Version - STRING = '3.0.10' + STRING = '3.0.11' GIT = '2.17.1' SVN = '1.9.7' CVSNT = '2.5.04'