Skip to content

Commit abf60fa

Browse files
committed
OTWO-6189 Made Branch Mandatory
1 parent 0f1e729 commit abf60fa

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

lib/ohloh_scm/git/validation.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
module OhlohScm
44
module Git
55
class Validation < OhlohScm::Validation
6-
def validate
7-
super
8-
@errors << [:branch_name, 'Invalid Branch Name.'] if scm.branch_name.to_s.empty?
9-
end
10-
116
private
127

138
def validate_server_connection

lib/ohloh_scm/validation.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def validate_server_connection; end
2626
def validate_attributes
2727
@errors = []
2828
@errors << url_errors
29-
@errors << branch_name_errors unless scm.branch_name.to_s.empty?
29+
@errors << branch_name_errors
3030
@errors << username_errors if scm.username
3131
@errors << password_errors if scm.password
3232
@errors.compact!
@@ -48,7 +48,9 @@ def url_errors
4848
# rubocop:enable Metrics/AbcSize
4949

5050
def branch_name_errors
51-
if scm.branch_name.length > 80
51+
if scm.branch_name.to_s.empty?
52+
[:branch_name, 'Invalid Branch Name.']
53+
elsif scm.branch_name.length > 80
5254
[:branch_name, 'The branch name must not be longer than 80 characters.']
5355
elsif !scm.branch_name.match?(/^[\w^\-\+\.\/\ ]+$/)
5456
[:branch_name, "The branch name may contain only letters, numbers, \

lib/ohloh_scm/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module OhlohScm
44
module Version
5-
STRING = '3.0.10'
5+
STRING = '3.0.11'
66
GIT = '2.17.1'
77
SVN = '1.9.7'
88
CVSNT = '2.5.04'

0 commit comments

Comments
 (0)