Commit 24332b7b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Revert "Make web editor work correctly after switch from satellites"

This reverts commit 435f680b.
parent d4cfa0bf
...@@ -17,8 +17,7 @@ module Files ...@@ -17,8 +17,7 @@ module Files
def after_commit(sha) def after_commit(sha)
commit = repository.commit(sha) commit = repository.commit(sha)
full_ref = 'refs/heads/' + (params[:new_branch] || ref) full_ref = 'refs/heads/' + (params[:new_branch] || ref)
old_sha = commit.parent_id || Gitlab::Git::BLANK_SHA GitPushService.new.execute(project, current_user, commit.parent_id, sha, full_ref)
GitPushService.new.execute(project, current_user, old_sha, sha, full_ref)
end end
end end
end end
require_relative "base_service" require_relative "base_service"
module Files module Files
class CreateService < Files::BaseService class CreateService < BaseService
def execute def execute
allowed = Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(ref) allowed = Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(ref)
......
require_relative "base_service" require_relative "base_service"
module Files module Files
class DeleteService < Files::BaseService class DeleteService < BaseService
def execute def execute
allowed = ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(ref) allowed = ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(ref)
......
require_relative "base_service" require_relative "base_service"
module Files module Files
class UpdateService < Files::BaseService class UpdateService < BaseService
def execute def execute
allowed = ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(ref) allowed = ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(ref)
......
...@@ -133,8 +133,7 @@ class GitPushService ...@@ -133,8 +133,7 @@ class GitPushService
end end
def is_default_branch?(ref) def is_default_branch?(ref)
Gitlab::Git.branch_ref?(ref) && Gitlab::Git.branch_ref?(ref) && Gitlab::Git.ref_name(ref) == project.default_branch
(Gitlab::Git.ref_name(ref) == project.default_branch || project.default_branch.nil?)
end end
def commit_user(commit) def commit_user(commit)
......
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