Fork now protects default branch on completion
This commit is contained in:
parent
74f2f9b30f
commit
f17735faa5
3 changed files with 14 additions and 4 deletions
|
@ -17,10 +17,7 @@ class RepositoryForkWorker
|
|||
project.repository_storage_path, project.disk_path)
|
||||
raise "Unable to fork project #{project_id} for repository #{source_disk_path} -> #{project.disk_path}" unless result
|
||||
|
||||
project.repository.after_import
|
||||
raise "Project #{project_id} had an invalid repository after fork" unless project.valid_repo?
|
||||
|
||||
project.import_finish
|
||||
project.after_import
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Makes forking protect default branch on completion
|
||||
merge_request:
|
||||
author:
|
||||
type: fixed
|
|
@ -47,6 +47,14 @@ describe RepositoryForkWorker do
|
|||
perform!
|
||||
end
|
||||
|
||||
it 'protects the default branch' do
|
||||
expect_fork_repository.and_return(true)
|
||||
|
||||
perform!
|
||||
|
||||
expect(fork_project.protected_branches.first.name).to eq(fork_project.default_branch)
|
||||
end
|
||||
|
||||
it 'flushes various caches' do
|
||||
expect_fork_repository.and_return(true)
|
||||
|
||||
|
|
Loading…
Reference in a new issue