diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/lib/gitlab/git/repository_spec.rb | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/lib/gitlab/git/repository_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index c917945499c..ef9b5a30c86 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -520,12 +520,13 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do forced: true, no_tags: true, timeout: described_class::GITLAB_PROJECTS_TIMEOUT, - prune: false + prune: false, + check_tags_changed: false } expect(repository.gitaly_repository_client).to receive(:fetch_remote).with('remote-name', expected_opts) - repository.fetch_remote('remote-name', ssh_auth: ssh_auth, forced: true, no_tags: true, prune: false) + repository.fetch_remote('remote-name', ssh_auth: ssh_auth, forced: true, no_tags: true, prune: false, check_tags_changed: false) end it_behaves_like 'wrapping gRPC errors', Gitlab::GitalyClient::RepositoryService, :fetch_remote do @@ -1191,25 +1192,25 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do let(:commit_3) { '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9' } let(:commit_1_files) do [ - OpenStruct.new(status: :ADDED, path: "files/executables/ls"), - OpenStruct.new(status: :ADDED, path: "files/executables/touch"), - OpenStruct.new(status: :ADDED, path: "files/links/regex.rb"), - OpenStruct.new(status: :ADDED, path: "files/links/ruby-style-guide.md"), - OpenStruct.new(status: :ADDED, path: "files/links/touch"), - OpenStruct.new(status: :MODIFIED, path: ".gitmodules"), - OpenStruct.new(status: :ADDED, path: "deeper/nested/six"), - OpenStruct.new(status: :ADDED, path: "nested/six") + Gitlab::Git::ChangedPath.new(status: :ADDED, path: "files/executables/ls"), + Gitlab::Git::ChangedPath.new(status: :ADDED, path: "files/executables/touch"), + Gitlab::Git::ChangedPath.new(status: :ADDED, path: "files/links/regex.rb"), + Gitlab::Git::ChangedPath.new(status: :ADDED, path: "files/links/ruby-style-guide.md"), + Gitlab::Git::ChangedPath.new(status: :ADDED, path: "files/links/touch"), + Gitlab::Git::ChangedPath.new(status: :MODIFIED, path: ".gitmodules"), + Gitlab::Git::ChangedPath.new(status: :ADDED, path: "deeper/nested/six"), + Gitlab::Git::ChangedPath.new(status: :ADDED, path: "nested/six") ] end let(:commit_2_files) do - [OpenStruct.new(status: :ADDED, path: "bin/executable")] + [Gitlab::Git::ChangedPath.new(status: :ADDED, path: "bin/executable")] end let(:commit_3_files) do [ - OpenStruct.new(status: :MODIFIED, path: ".gitmodules"), - OpenStruct.new(status: :ADDED, path: "gitlab-shell") + Gitlab::Git::ChangedPath.new(status: :MODIFIED, path: ".gitmodules"), + Gitlab::Git::ChangedPath.new(status: :ADDED, path: "gitlab-shell") ] end @@ -1217,7 +1218,7 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do collection = repository.find_changed_paths([commit_1, commit_2, commit_3]) expect(collection).to be_a(Enumerable) - expect(collection.to_a).to eq(commit_1_files + commit_2_files + commit_3_files) + expect(collection.as_json).to eq((commit_1_files + commit_2_files + commit_3_files).as_json) end it 'returns no paths when SHAs are invalid' do @@ -1231,7 +1232,7 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do collection = repository.find_changed_paths([nil, commit_1]) expect(collection).to be_a(Enumerable) - expect(collection.to_a).to eq(commit_1_files) + expect(collection.as_json).to eq(commit_1_files.as_json) end it 'returns no paths when the commits are nil' do |