diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2018-03-07 04:25:12 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2018-03-08 17:54:21 +0300 |
commit | bb2bf39ddfc05db887d4a02ad3a38dbf81beed1a (patch) | |
tree | e175678908f5b0f1d0d469adb0859ecd88dd3d4e /app/services/merge_requests | |
parent | 5171e2f3d4fdc681a58e11f9615afa968324a278 (diff) |
Cache `#can_be_resolved_in_ui?` git operations
Diffstat (limited to 'app/services/merge_requests')
-rw-r--r-- | app/services/merge_requests/conflicts/list_service.rb | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/app/services/merge_requests/conflicts/list_service.rb b/app/services/merge_requests/conflicts/list_service.rb index ca9a33678e4..72cbc49adb2 100644 --- a/app/services/merge_requests/conflicts/list_service.rb +++ b/app/services/merge_requests/conflicts/list_service.rb @@ -17,15 +17,7 @@ module MergeRequests return @conflicts_can_be_resolved_in_ui = false unless merge_request.has_complete_diff_refs? return @conflicts_can_be_resolved_in_ui = false if merge_request.branch_missing? - begin - # Try to parse each conflict. If the MR's mergeable status hasn't been - # updated, ensure that we don't say there are conflicts to resolve - # when there are no conflict files. - conflicts.files.each(&:lines) - @conflicts_can_be_resolved_in_ui = conflicts.files.length > 0 - rescue Gitlab::Git::CommandError, Gitlab::Git::Conflict::Parser::UnresolvableError, Gitlab::Git::Conflict::Resolver::ConflictSideMissing - @conflicts_can_be_resolved_in_ui = false - end + @conflicts_can_be_resolved_in_ui = conflicts.can_be_resolved_in_ui? end def conflicts |