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
435f680b
Unverified
Commit
435f680b
authored
Jun 02, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make web editor work correctly after switch from satellites
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
89978126
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
5 deletions
+7
-5
base_service.rb
app/services/files/base_service.rb
+2
-1
create_service.rb
app/services/files/create_service.rb
+1
-1
delete_service.rb
app/services/files/delete_service.rb
+1
-1
update_service.rb
app/services/files/update_service.rb
+1
-1
git_push_service.rb
app/services/git_push_service.rb
+2
-1
No files found.
app/services/files/base_service.rb
View file @
435f680b
...
...
@@ -17,7 +17,8 @@ module Files
def
after_commit
(
sha
)
commit
=
repository
.
commit
(
sha
)
full_ref
=
'refs/heads/'
+
(
params
[
:new_branch
]
||
ref
)
GitPushService
.
new
.
execute
(
project
,
current_user
,
commit
.
parent_id
,
sha
,
full_ref
)
old_sha
=
commit
.
parent_id
||
Gitlab
::
Git
::
BLANK_SHA
GitPushService
.
new
.
execute
(
project
,
current_user
,
old_sha
,
sha
,
full_ref
)
end
end
end
app/services/files/create_service.rb
View file @
435f680b
require_relative
"base_service"
module
Files
class
CreateService
<
BaseService
class
CreateService
<
Files
::
BaseService
def
execute
allowed
=
Gitlab
::
GitAccess
.
new
(
current_user
,
project
).
can_push_to_branch?
(
ref
)
...
...
app/services/files/delete_service.rb
View file @
435f680b
require_relative
"base_service"
module
Files
class
DeleteService
<
BaseService
class
DeleteService
<
Files
::
BaseService
def
execute
allowed
=
::
Gitlab
::
GitAccess
.
new
(
current_user
,
project
).
can_push_to_branch?
(
ref
)
...
...
app/services/files/update_service.rb
View file @
435f680b
require_relative
"base_service"
module
Files
class
UpdateService
<
BaseService
class
UpdateService
<
Files
::
BaseService
def
execute
allowed
=
::
Gitlab
::
GitAccess
.
new
(
current_user
,
project
).
can_push_to_branch?
(
ref
)
...
...
app/services/git_push_service.rb
View file @
435f680b
...
...
@@ -127,7 +127,8 @@ class GitPushService
end
def
is_default_branch?
(
ref
)
Gitlab
::
Git
.
branch_ref?
(
ref
)
&&
Gitlab
::
Git
.
ref_name
(
ref
)
==
project
.
default_branch
Gitlab
::
Git
.
branch_ref?
(
ref
)
&&
(
Gitlab
::
Git
.
ref_name
(
ref
)
==
project
.
default_branch
||
project
.
default_branch
.
nil?
)
end
def
commit_user
(
commit
)
...
...
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