BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8c727fee
Commit
8c727fee
authored
Dec 07, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'small-fixes' into 'master'
Small fixes Improve application stability over unexpected cases See merge request !1310
parents
f59032e7
4491a3d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
_state_widget.html.haml
...iews/projects/merge_requests/show/_state_widget.html.haml
+4
-3
git_access.rb
lib/gitlab/git_access.rb
+12
-3
No files found.
app/views/projects/merge_requests/show/_state_widget.html.haml
View file @
8c727fee
...
...
@@ -19,8 +19,10 @@
-
if
@merge_request
.
merged?
%h4
Merged by
#{
link_to_member
(
@project
,
@merge_request
.
merge_event
.
author
,
avatar:
false
)
}
#{
time_ago_with_tooltip
(
@merge_request
.
merge_event
.
created_at
)
}
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
)
}
=
render
"projects/merge_requests/show/remove_source_branch"
-
if
@merge_request
.
locked?
...
...
@@ -46,4 +48,3 @@
Accepting this merge request will close
#{
@closes_issues
.
size
==
1
?
'issue'
:
'issues'
}
=
succeed
'.'
do
!=
gfm
(
issues_sentence
(
@closes_issues
))
lib/gitlab/git_access.rb
View file @
8c727fee
...
...
@@ -49,8 +49,17 @@ module Gitlab
end
def
push_access_check
(
user
,
project
,
changes
)
return
build_status_object
(
false
,
"You don't have access"
)
unless
user
&&
user_allowed?
(
user
)
return
build_status_object
(
true
)
if
changes
.
blank?
unless
user
&&
user_allowed?
(
user
)
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
)
...
...
@@ -79,7 +88,7 @@ module Gitlab
else
:push_code_to_protected_branches
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
:admin_project
else
...
...
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