Skip to content
Snippets Groups Projects
Verified Commit 435f680b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Make web editor work correctly after switch from satellites

parent 89978126
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
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)
 
Loading
Loading
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)
 
Loading
Loading
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)
 
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment