Commit 64edb27aa95cef237564b2f6dad38ba6208f3745

Authored by Dmitriy Zaporozhets
1 parent 31239d11

Extend Gitlab#default_regex. Dont allow project path ends with .git

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/views/projects/edit.html.haml
... ... @@ -144,7 +144,9 @@
144 144 %span Path
145 145 .controls
146 146 .control-group
147   - = f.text_field :path
  147 + .input-append
  148 + = f.text_field :path
  149 + %span.add-on .git
148 150 %ul
149 151 %li Be careful. Renaming a project's repository can have unintended side effects.
150 152 %li You will need to update your local repositories to point to the new location.
... ...
lib/gitlab/regex.rb
... ... @@ -44,7 +44,7 @@ module Gitlab
44 44 protected
45 45  
46 46 def default_regex
47   - /\A[a-zA-Z0-9][a-zA-Z0-9_\-\.]*\z/
  47 + /\A[a-zA-Z0-9][a-zA-Z0-9_\-\.]*(?<!\.git)\z/
48 48 end
49 49 end
50 50 end
... ...