diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
commit | 419c53ec62de6e97a517abd5fdd4cbde3a942a34 (patch) | |
tree | 1f43a548b46bca8a5fb8fe0c31cef1883d49c5b6 /spec/lib/gitlab/git/repository_spec.rb | |
parent | 1da20d9135b3ad9e75e65b028bffc921aaf8deb7 (diff) |
Add latest changes from gitlab-org/gitlab@16-5-stable-eev16.5.0-rc42
Diffstat (limited to 'spec/lib/gitlab/git/repository_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 63 |
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 |