Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/git/repository_spec.rb')
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb63
1 files changed, 10 insertions, 53 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index 18a090a00be..47b5986cfd8 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -203,25 +203,6 @@ RSpec.describe Gitlab::Git::Repository, feature_category: :source_code_managemen
expect(metadata['CommitId']).to eq(expected_commit_id)
end
end
-
- context 'when resolve_ambiguous_archives is disabled' do
- before do
- stub_feature_flags(resolve_ambiguous_archives: false)
- end
-
- where(:ref, :expected_commit_id, :desc) do
- 'refs/heads/branch-merged' | ref(:branch_merged_commit_id) | 'when tag looks like a branch (difference!)'
- 'branch-merged' | ref(:branch_master_commit_id) | 'when tag has the same name as a branch'
- ref(:branch_merged_commit_id) | ref(:branch_merged_commit_id) | 'when tag looks like a commit id'
- 'v0.0.0' | ref(:branch_master_commit_id) | 'when tag looks like a normal tag'
- end
-
- with_them do
- it 'selects the correct commit' do
- expect(metadata['CommitId']).to eq(expected_commit_id)
- end
- end
- end
end
context 'when branch is ambiguous' do
@@ -241,25 +222,6 @@ RSpec.describe Gitlab::Git::Repository, feature_category: :source_code_managemen
expect(metadata['CommitId']).to eq(expected_commit_id)
end
end
-
- context 'when resolve_ambiguous_archives is disabled' do
- before do
- stub_feature_flags(resolve_ambiguous_archives: false)
- end
-
- where(:ref, :expected_commit_id, :desc) do
- 'refs/tags/v1.0.0' | ref(:tag_1_0_0_commit_id) | 'when branch looks like a tag (difference!)'
- 'v1.0.0' | ref(:tag_1_0_0_commit_id) | 'when branch has the same name as a tag'
- ref(:branch_merged_commit_id) | ref(:branch_merged_commit_id) | 'when branch looks like a commit id'
- 'just-a-normal-branch' | ref(:branch_master_commit_id) | 'when branch looks like a normal branch'
- end
-
- with_them do
- it 'selects the correct commit' do
- expect(metadata['CommitId']).to eq(expected_commit_id)
- end
- end
- end
end
context 'when ref is HEAD' do
@@ -2650,21 +2612,6 @@ RSpec.describe Gitlab::Git::Repository, feature_category: :source_code_managemen
end
end
- describe '#rename' do
- let(:repository) { mutable_repository }
-
- it 'moves the repository' do
- checksum = repository.checksum
- new_relative_path = "rename_test/relative/path"
- renamed_repository = Gitlab::Git::Repository.new(repository.storage, new_relative_path, nil, nil)
-
- repository.rename(new_relative_path)
-
- expect(renamed_repository.checksum).to eq(checksum)
- expect(repository.exists?).to be false
- end
- end
-
describe '#remove' do
let(:repository) { mutable_repository }
@@ -2833,4 +2780,14 @@ RSpec.describe Gitlab::Git::Repository, feature_category: :source_code_managemen
end
end
end
+
+ describe '#get_file_attributes' do
+ let(:rev) { 'master' }
+ let(:paths) { ['file.txt'] }
+ let(:attrs) { ['text'] }
+
+ it_behaves_like 'wrapping gRPC errors', Gitlab::GitalyClient::RepositoryService, :get_file_attributes do
+ subject { repository.get_file_attributes(rev, paths, attrs) }
+ end
+ end
end