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:
authorNick Thomas <nick@gitlab.com>2018-04-18 21:11:50 +0300
committerNick Thomas <nick@gitlab.com>2018-04-19 14:47:23 +0300
commit276d4eb80cade01f1d035d849a90009d02ae926d (patch)
treed68a53a85ebfd9635729a143dbf5ce90bcbf4acd /app/controllers/projects/repositories_controller.rb
parent05aa49765f6886e7530fcd30b4925f80013cef41 (diff)
Fix specifying a non-default ref when requesting an archive using the legacy URL
Diffstat (limited to 'app/controllers/projects/repositories_controller.rb')
-rw-r--r--app/controllers/projects/repositories_controller.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/controllers/projects/repositories_controller.rb b/app/controllers/projects/repositories_controller.rb
index 937b0e39cbd..d01f324e6fd 100644
--- a/app/controllers/projects/repositories_controller.rb
+++ b/app/controllers/projects/repositories_controller.rb
@@ -28,11 +28,12 @@ class Projects::RepositoriesController < Projects::ApplicationController
end
def assign_archive_vars
- @id = params[:id]
-
- return unless @id
-
- @ref, @filename = extract_ref(@id)
+ if params[:id]
+ @ref, @filename = extract_ref(params[:id])
+ else
+ @ref = params[:ref]
+ @filename = nil
+ end
rescue InvalidPathError
render_404
end