diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-22 06:08:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-22 06:08:17 +0300 |
commit | 1127990db899d0fb36c900c81857ff6107e611d4 (patch) | |
tree | d704d0c91b9a91815cc7e9b9fb1f09c722b2eda4 /spec/models | |
parent | 4584816f15e57af3fbbf1d1280b691549384e1aa (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/repository_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index c698b40a4c0..e2a148165ab 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -252,6 +252,21 @@ describe Repository do end end end + + context 'with filename with glob characters' do + let(:filename) { ':wq' } + let(:newrev) { project.repository.commit('master').sha } + + before do + create_file_in_repo(project, 'master', 'master', filename, 'Test file') + end + + subject { repository.last_commit_for_path('master', filename, literal_pathspec: true).id } + + it 'returns a commit SHA' do + expect(subject).to eq(newrev) + end + end end describe '#last_commit_id_for_path' do @@ -276,6 +291,21 @@ describe Repository do end end end + + context 'with filename with glob characters' do + let(:filename) { ':wq' } + let(:newrev) { project.repository.commit('master').sha } + + before do + create_file_in_repo(project, 'master', 'master', filename, 'Test file') + end + + subject { repository.last_commit_id_for_path('master', filename, literal_pathspec: true) } + + it 'returns a commit SHA' do + expect(subject).to eq(newrev) + end + end end describe '#commits' do |