Skip to content

Commit 93368f6

Browse files
author
root
committed
Fix RepositoryMirror regex
1 parent a972858 commit 93368f6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: app/models/repository_mirror.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class RepositoryMirror < ActiveRecord::Base
55
PUSHMODE_FORCE = 1
66
PUSHMODE_FAST_FORWARD = 2
77

8-
VALID_MIRROR_REGEX = /\A(ssh:\/\/)([\w\.@]+)(\:[\d]+)?([\w\/\-\.~]+)(\.git)?\z/i
8+
VALID_MIRROR_REGEX = /\A(ssh:\/\/)([\w\-\.@]+)(\:[\d]+)?([\w\/\-\.~]+)(\.git)?\z/i
99

1010
## Attributes
1111
attr_accessible :url, :push_mode, :include_all_branches, :include_all_tags, :explicit_refspec, :active

Diff for: spec/models/repository_mirror_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
VALID_URLS = [
88
'ssh://[email protected]:2222/path/to/repo.git',
99
'ssh://[email protected]/path/to/repo.git',
10+
'ssh://[email protected]/path.git',
1011
'ssh://host.xz:2222/path/to/repo.git',
1112
'ssh://host.xz/path/to/repo.git',
1213
'ssh://[email protected]/path/to/repo.git',

0 commit comments

Comments
 (0)