BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0ece6bd8
Commit
0ece6bd8
authored
Apr 10, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `\A` and `\z` in regexes instead of `^` and `$`.
parent
6cf7dd62
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
14 deletions
+12
-14
application_controller.rb
app/controllers/application_controller.rb
+1
-1
application_helper.rb
app/helpers/application_helper.rb
+1
-1
gitlab_markdown_helper.rb
app/helpers/gitlab_markdown_helper.rb
+2
-2
submodule_helper.rb
app/helpers/submodule_helper.rb
+1
-1
irker_service.rb
app/models/project_services/irker_service.rb
+1
-1
repository.rb
app/models/repository.rb
+2
-2
create_tag_service.rb
app/services/create_tag_service.rb
+1
-3
post_receive.rb
app/workers/post_receive.rb
+2
-2
devise.rb
config/initializers/devise.rb
+1
-1
No files found.
app/controllers/application_controller.rb
View file @
0ece6bd8
...
...
@@ -153,7 +153,7 @@ class ApplicationController < ActionController::Base
end
def
method_missing
(
method_sym
,
*
arguments
,
&
block
)
if
method_sym
.
to_s
=~
/
^authorize_(.*)!$
/
if
method_sym
.
to_s
=~
/
\Aauthorize_(.*)!\z
/
authorize_project!
(
$1
.
to_sym
)
else
super
...
...
app/helpers/application_helper.rb
View file @
0ece6bd8
...
...
@@ -125,7 +125,7 @@ module ApplicationHelper
# If reference is commit id - we should add it to branch/tag selectbox
if
(
@ref
&&
!
options
.
flatten
.
include?
(
@ref
)
&&
@ref
=~
/
^[0-9a-zA-Z]{6,52}$
/
)
@ref
=~
/
\A[0-9a-zA-Z]{6,52}\z
/
)
options
<<
[
'Commit'
,
[
@ref
]]
end
...
...
app/helpers/gitlab_markdown_helper.rb
View file @
0ece6bd8
...
...
@@ -13,7 +13,7 @@ module GitlabMarkdownHelper
def
link_to_gfm
(
body
,
url
,
html_options
=
{})
return
""
if
body
.
blank?
escaped_body
=
if
body
=~
/
^
\<img/
escaped_body
=
if
body
=~
/
\A
\<img/
body
else
escape_once
(
body
)
...
...
@@ -139,7 +139,7 @@ module GitlabMarkdownHelper
@project
.
path_with_namespace
,
path_with_ref
(
file_path
),
file_path
].
compact
.
join
(
"/"
).
gsub
(
/
^\/*|\/*$
/
,
''
)
+
id
].
compact
.
join
(
"/"
).
gsub
(
/
\A\/*|\/*\z
/
,
''
)
+
id
end
def
sanitize_slashes
(
path
)
...
...
app/helpers/submodule_helper.rb
View file @
0ece6bd8
...
...
@@ -44,7 +44,7 @@ module SubmoduleHelper
def
relative_self_url?
(
url
)
# (./)?(../repo.git) || (./)?(../../project/repo.git) )
url
=~
/
^((\.\/)?(\.\.\/))(?!(\.\.)|(.*\/)).*\.git\Z/
||
url
=~
/^((\.\/)?(\.\.\/){2})(?!(\.\.))([^\/]*)\/(?!(\.\.)|(.*\/)).*\.git\Z
/
url
=~
/
\A((\.\/)?(\.\.\/))(?!(\.\.)|(.*\/)).*\.git\z/
||
url
=~
/\A((\.\/)?(\.\.\/){2})(?!(\.\.))([^\/]*)\/(?!(\.\.)|(.*\/)).*\.git\z
/
end
def
standard_links
(
host
,
namespace
,
project
,
commit
)
...
...
app/models/project_services/irker_service.rb
View file @
0ece6bd8
...
...
@@ -148,7 +148,7 @@ class IrkerService < Service
def
consider_uri
(
uri
)
# Authorize both irc://domain.com/#chan and irc://domain.com/chan
if
uri
.
is_a?
(
URI
)
&&
uri
.
scheme
[
/^ircs?
$
/
]
&&
!
uri
.
path
.
nil?
if
uri
.
is_a?
(
URI
)
&&
uri
.
scheme
[
/^ircs?
\z
/
]
&&
!
uri
.
path
.
nil?
# Do not authorize irc://domain.com/
if
uri
.
fragment
.
nil?
&&
uri
.
path
.
length
>
1
uri
.
to_s
...
...
app/models/repository.rb
View file @
0ece6bd8
...
...
@@ -199,7 +199,7 @@ class Repository
def
changelog
cache
.
fetch
(
:changelog
)
do
tree
(
:head
).
blobs
.
find
do
|
file
|
file
.
name
=~
/
^
(changelog|history)/i
file
.
name
=~
/
\A
(changelog|history)/i
end
end
end
...
...
@@ -207,7 +207,7 @@ class Repository
def
license
cache
.
fetch
(
:license
)
do
tree
(
:head
).
blobs
.
find
do
|
file
|
file
.
name
=~
/
^
license/i
file
.
name
=~
/
\A
license/i
end
end
end
...
...
app/services/create_tag_service.rb
View file @
0ece6bd8
...
...
@@ -13,9 +13,7 @@ class CreateTagService < BaseService
return
error
(
'Tag already exists'
)
end
if
message
message
.
gsub!
(
/^\s+|\s+$/
,
''
)
end
message
.
strip!
if
message
repository
.
add_tag
(
tag_name
,
ref
,
message
)
new_tag
=
repository
.
find_tag
(
tag_name
)
...
...
app/workers/post_receive.rb
View file @
0ece6bd8
...
...
@@ -11,8 +11,8 @@ class PostReceive
log
(
"Check gitlab.yml config for correct gitlab_shell.repos_path variable.
\"
#{
Gitlab
.
config
.
gitlab_shell
.
repos_path
}
\"
does not match
\"
#{
repo_path
}
\"
"
)
end
repo_path
.
gsub!
(
/\.git
$
/
,
""
)
repo_path
.
gsub!
(
/
^
\//
,
""
)
repo_path
.
gsub!
(
/\.git
\z
/
,
""
)
repo_path
.
gsub!
(
/
\A
\//
,
""
)
project
=
Project
.
find_with_namespace
(
repo_path
)
...
...
config/initializers/devise.rb
View file @
0ece6bd8
...
...
@@ -208,7 +208,7 @@ Devise.setup do |config|
if
Gitlab
::
LDAP
::
Config
.
enabled?
Gitlab
.
config
.
ldap
.
servers
.
values
.
each
do
|
server
|
if
server
[
'allow_username_or_email_login'
]
email_stripping_proc
=
->
(
name
)
{
name
.
gsub
(
/@.*
$
/
,
''
)}
email_stripping_proc
=
->
(
name
)
{
name
.
gsub
(
/@.*
\z
/
,
''
)}
else
email_stripping_proc
=
->
(
name
)
{
name
}
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment