summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/git/repository_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/git/repository_spec.rb')
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb31
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