Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
1a9da917
Commit
1a9da917
authored
May 15, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Surround Project.reference_pattern in parenthesis inside other patterns
parent
5cc9b17b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
+7
-4
app/models/commit.rb
app/models/commit.rb
+4
-1
app/models/issue.rb
app/models/issue.rb
+1
-1
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
app/models/snippet.rb
app/models/snippet.rb
+1
-1
No files found.
app/models/commit.rb
View file @
1a9da917
...
@@ -72,7 +72,10 @@ class Commit
...
@@ -72,7 +72,10 @@ class Commit
#
#
# This pattern supports cross-project references.
# This pattern supports cross-project references.
def
self
.
reference_pattern
def
self
.
reference_pattern
%r{(?:
#{
Project
.
reference_pattern
}#{
reference_prefix
}
)?(?<commit>
\h
{6,40})}
%r{
(?:
#{
Project
.
reference_pattern
}#{
reference_prefix
}
)?
(?<commit>
\h
{6,40})
}x
end
end
def
to_reference
(
from_project
=
nil
)
def
to_reference
(
from_project
=
nil
)
...
...
app/models/issue.rb
View file @
1a9da917
...
@@ -63,7 +63,7 @@ class Issue < ActiveRecord::Base
...
@@ -63,7 +63,7 @@ class Issue < ActiveRecord::Base
# This pattern supports cross-project references.
# This pattern supports cross-project references.
def
self
.
reference_pattern
def
self
.
reference_pattern
%r{
%r{
#{
Project
.
reference_pattern
}
?
(
#{
Project
.
reference_pattern
}
)
?
#{
Regexp
.
escape
(
reference_prefix
)
}
(?<issue>
\d
+)
#{
Regexp
.
escape
(
reference_prefix
)
}
(?<issue>
\d
+)
}x
}x
end
end
...
...
app/models/merge_request.rb
View file @
1a9da917
...
@@ -145,7 +145,7 @@ class MergeRequest < ActiveRecord::Base
...
@@ -145,7 +145,7 @@ class MergeRequest < ActiveRecord::Base
# This pattern supports cross-project references.
# This pattern supports cross-project references.
def
self
.
reference_pattern
def
self
.
reference_pattern
%r{
%r{
#{
Project
.
reference_pattern
}
?
(
#{
Project
.
reference_pattern
}
)
?
#{
Regexp
.
escape
(
reference_prefix
)
}
(?<merge_request>
\d
+)
#{
Regexp
.
escape
(
reference_prefix
)
}
(?<merge_request>
\d
+)
}x
}x
end
end
...
...
app/models/snippet.rb
View file @
1a9da917
...
@@ -61,7 +61,7 @@ class Snippet < ActiveRecord::Base
...
@@ -61,7 +61,7 @@ class Snippet < ActiveRecord::Base
# This pattern supports cross-project references.
# This pattern supports cross-project references.
def
self
.
reference_pattern
def
self
.
reference_pattern
%r{
%r{
#{
Project
.
reference_pattern
}
?
(
#{
Project
.
reference_pattern
}
)
?
#{
Regexp
.
escape
(
reference_prefix
)
}
(?<snippet>
\d
+)
#{
Regexp
.
escape
(
reference_prefix
)
}
(?<snippet>
\d
+)
}x
}x
end
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