Skip to content

Commit db2da65

Browse files
author
root
committed
Fix #311
1 parent bb810de commit db2da65

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: app/models/repository_mirror.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RepositoryMirror < ActiveRecord::Base
2222
## ssh://[email protected]:2222/project1/project2/project3/project4.git
2323
validates :url, :presence => true,
2424
:uniqueness => { :case_sensitive => false, :scope => :repository_id },
25-
:format => { :with => /\A(ssh:\/\/)([\w\.@]+)(\:[\d]+)?([\w\/\-~]+)(\.git)?\z/i }
25+
:format => { :with => /\A(ssh:\/\/)([\w\.@]+)(\:[\d]+)?([\w\/\-\.~]+)(\.git)?\z/i }
2626

2727
validates :push_mode, :presence => true,
2828
:numericality => { :only_integer => true },

Diff for: spec/models/repository_mirror_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
'ssh://[email protected]/~user/path/to/repo.git',
1515
'ssh://host.xz/~user/path/to/repo.git',
1616
'ssh://[email protected]/~/path/to/repo.git',
17-
'ssh://host.xz/~/path/to/repo.git'
17+
'ssh://host.xz/~/path/to/repo.git',
18+
'ssh://host.xz/~/path.to/repo.git'
1819
]
1920

2021

0 commit comments

Comments
 (0)