Commit 8c727fee authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'small-fixes' into 'master'

Small fixes

Improve application stability over unexpected cases

See merge request !1310
parents f59032e7 4491a3d1
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
- if @merge_request.merged? - if @merge_request.merged?
%h4 %h4
Merged by #{link_to_member(@project, @merge_request.merge_event.author, avatar: false)} Merged
- if @merge_request.merge_event
by #{link_to_member(@project, @merge_request.merge_event.author, avatar: false)}
#{time_ago_with_tooltip(@merge_request.merge_event.created_at)} #{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
= render "projects/merge_requests/show/remove_source_branch" = render "projects/merge_requests/show/remove_source_branch"
...@@ -46,4 +48,3 @@ ...@@ -46,4 +48,3 @@
Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'} Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'}
= succeed '.' do = succeed '.' do
!= gfm(issues_sentence(@closes_issues)) != gfm(issues_sentence(@closes_issues))
...@@ -49,8 +49,17 @@ module Gitlab ...@@ -49,8 +49,17 @@ module Gitlab
end end
def push_access_check(user, project, changes) def push_access_check(user, project, changes)
return build_status_object(false, "You don't have access") unless user && user_allowed?(user) unless user && user_allowed?(user)
return build_status_object(true) if changes.blank? return build_status_object(false, "You don't have access")
end
if changes.blank?
return build_status_object(true)
end
unless project.repository.exists?
return build_status_object(false, "Repository does not exist")
end
changes = changes.lines if changes.kind_of?(String) changes = changes.lines if changes.kind_of?(String)
...@@ -79,7 +88,7 @@ module Gitlab ...@@ -79,7 +88,7 @@ module Gitlab
else else
:push_code_to_protected_branches :push_code_to_protected_branches
end end
elsif project.repository && project.repository.tag_names.include?(tag_name(ref)) elsif project.repository.tag_names.include?(tag_name(ref))
# Prevent any changes to existing git tag unless user has permissions # Prevent any changes to existing git tag unless user has permissions
:admin_project :admin_project
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment