diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-06-07 10:01:52 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-06-07 10:01:52 +0000 |
commit | 4b086b74509500998bdc28a82871aa2c9003a194 (patch) | |
tree | 24ae22da7dda0e328981c355417f691568f8f2b5 /spec/requests/api | |
parent | fd19f887dfeeeedb483c4a4fb32f9f768e89389c (diff) | |
parent | b8704dce72fd8992b1f785c0ffa2f2c0eab81334 (diff) | |
download | gitlab-ce-4b086b74509500998bdc28a82871aa2c9003a194.tar.gz |
Merge branch '62418-project-default-git-depth' into 'master'
Add project level git depth setting
Closes #59688
See merge request gitlab-org/gitlab-ce!28919
Diffstat (limited to 'spec/requests/api')
-rw-r--r-- | spec/requests/api/runner_spec.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index 3202050ac20..038c958b5cc 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -444,8 +444,8 @@ describe API::Runner, :clean_gitlab_redis_shared_state do 'sha' => job.sha, 'before_sha' => job.before_sha, 'ref_type' => 'branch', - 'refspecs' => %w[+refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*], - 'depth' => 0 } + 'refspecs' => ["+refs/heads/#{job.ref}:refs/remotes/origin/#{job.ref}"], + 'depth' => project.default_git_depth } end let(:expected_steps) do @@ -531,7 +531,11 @@ describe API::Runner, :clean_gitlab_redis_shared_state do end end - context 'when GIT_DEPTH is not specified' do + context 'when GIT_DEPTH is not specified and there is no default git depth for the project' do + before do + project.update!(default_git_depth: nil) + end + it 'specifies refspecs' do request_job @@ -587,7 +591,11 @@ describe API::Runner, :clean_gitlab_redis_shared_state do end end - context 'when GIT_DEPTH is not specified' do + context 'when GIT_DEPTH is not specified and there is no default git depth for the project' do + before do + project.update!(default_git_depth: nil) + end + it 'specifies refspecs' do request_job |