diff options
author | Stan Hu <stanhu@gmail.com> | 2018-04-08 15:47:54 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-04-08 15:56:07 +0300 |
commit | 5c735af3b507d4d1514d1fd66318679a4a2e648e (patch) | |
tree | d8a54aa4d3fdab5878f62b3feefbe855fd991a34 /spec/controllers | |
parent | dd552d06f6e39d5e6138a33bd7c1bffb2d3dbb1d (diff) |
Handle legacy repository archive requests with no ref given
The legacy endpoint requires no reference and defaults to the root
ref.
Closes #45154
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/repositories_controller_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/controllers/projects/repositories_controller_spec.rb b/spec/controllers/projects/repositories_controller_spec.rb index 31b1b52fdd1..c3b71458e38 100644 --- a/spec/controllers/projects/repositories_controller_spec.rb +++ b/spec/controllers/projects/repositories_controller_spec.rb @@ -34,6 +34,12 @@ describe Projects::RepositoriesController do expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with("git-archive:") end + it 'handles legacy queries with no ref' do + get :archive, namespace_id: project.namespace, project_id: project, format: "zip" + + expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with("git-archive:") + end + context "when the service raises an error" do before do allow(Gitlab::Workhorse).to receive(:send_git_archive).and_raise("Archive failed") |