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
Kazuhiko Shiozaki
gitlab-ce
Commits
34f1dbb1
Commit
34f1dbb1
authored
Apr 15, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better commit lookup for CommitRangeReferenceFilter
parent
6853465a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
lib/gitlab/markdown/commit_range_reference_filter.rb
lib/gitlab/markdown/commit_range_reference_filter.rb
+15
-3
No files found.
lib/gitlab/markdown/commit_range_reference_filter.rb
View file @
34f1dbb1
...
...
@@ -24,6 +24,12 @@ module Gitlab
end
end
def
initialize
(
*
args
)
super
@commit_map
=
{}
end
# Pattern used to extract commit range references from text
#
# The beginning and ending SHA1 sums can be between 6 and 40 hex
...
...
@@ -76,10 +82,16 @@ module Gitlab
[
from_id
,
to_id
]
end
def
commit
(
id
)
unless
@commit_map
[
id
]
@commit_map
[
id
]
=
project
.
repository
.
commit
(
id
)
end
@commit_map
[
id
]
end
def
valid_range?
(
project
,
from_id
,
to_id
)
project
.
valid_repo?
&&
project
.
repository
.
commit
(
from_id
)
&&
project
.
repository
.
commit
(
to_id
)
project
.
valid_repo?
&&
commit
(
from_id
)
&&
commit
(
to_id
)
end
def
url_for_commit_range
(
project
,
from_id
,
to_id
)
...
...
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