diff options
Diffstat (limited to 'app/presenters/merge_request_presenter.rb')
-rw-r--r-- | app/presenters/merge_request_presenter.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/presenters/merge_request_presenter.rb b/app/presenters/merge_request_presenter.rb index 8d2baa6ee99..5c23af6e821 100644 --- a/app/presenters/merge_request_presenter.rb +++ b/app/presenters/merge_request_presenter.rb @@ -266,10 +266,15 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated def issues_sentence(project, issues) # Sorting based on the `#123` or `group/project#123` reference will sort - # local issues first. - issues.map do |issue| + # local issues numerically first. + issue_refs = issues.map do |issue| issue.to_reference(project) - end.sort.to_sentence + end + + issue_refs.sort_by do |issue_ref| + path_section = issue_ref.split('#') + [path_section.first, path_section.last.to_i] + end.to_sentence end def user_can_fork_project? |