Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop
This commit is contained in:
commit
9462e14628
|
@ -1,5 +1,6 @@
|
|||
class Api::V1::Projects::SyncRepositoriesController < Api::V1::BaseController
|
||||
before_action :require_public_and_member_above
|
||||
before_action :require_public_and_member_above, except: [:sync]
|
||||
before_action :load_project, only: [:sync]
|
||||
|
||||
def index
|
||||
@sync_repositories = @project.sync_repositories
|
||||
|
@ -29,7 +30,7 @@ class Api::V1::Projects::SyncRepositoriesController < Api::V1::BaseController
|
|||
else
|
||||
@sync_repositories = SyncRepository.where(project: @project, sync_direction: params[:sync_direction])
|
||||
end
|
||||
branch = params[:ref].split("refs/heads/")[-1]
|
||||
branch = params[:payload].present? ? JSON.parse(params[:payload])["ref"].split("/")[-1] : params[:ref].split("/")[-1] rescue nil
|
||||
if params[:sync_direction].to_i == 1
|
||||
@sync_repository_branches = SyncRepositoryBranch.where(sync_repository_id: @sync_repositories, gitlink_branch_name: branch, enable: true)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue