Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTWO-6189 Made Branch Mandatory #124

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/ohloh_scm/git/validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/ohloh_scm/validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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, \
Expand Down
2 changes: 1 addition & 1 deletion lib/ohloh_scm/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down