diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-07-22 09:56:43 +0200 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-07-22 09:56:43 +0200 |
commit | 39dc39e33529ac3632e5d5a6fa06bf6908fb4fa4 (patch) | |
tree | 0454b5668cde4d476f79decfa54a3b658b5bd8f9 /app | |
parent | 806be101a9c869ee3ce6deec24586486f0417cc2 (diff) | |
parent | 6bf1beaf94a5ef63632475bad56bfa2099a4513d (diff) | |
download | gitlab-ce-39dc39e33529ac3632e5d5a6fa06bf6908fb4fa4.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/dispatcher.js.coffee | 5 | ||||
-rw-r--r-- | app/controllers/projects/tree_controller.rb | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index 2ab148bc296..81e73799271 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -128,7 +128,10 @@ class Dispatcher shortcut_handler = new ShortcutsNavigation() new ZenMode() new DropzoneInput($('.wiki-form')) - when 'snippets', 'labels', 'graphs' + when 'snippets' + shortcut_handler = new ShortcutsNavigation() + new ZenMode() if path[2] == 'show' + when 'labels', 'graphs' shortcut_handler = new ShortcutsNavigation() when 'project_members', 'deploy_keys', 'hooks', 'services', 'protected_branches' shortcut_handler = new ShortcutsNavigation() diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index b659e15f242..92e4bc16d9d 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -7,13 +7,15 @@ class Projects::TreeController < Projects::ApplicationController before_action :authorize_download_code! def show + return not_found! unless @repository.commit(@ref) + if tree.entries.empty? if @repository.blob_at(@commit.id, @path) redirect_to( namespace_project_blob_path(@project.namespace, @project, File.join(@ref, @path)) ) and return - else + elsif @path.present? return not_found! end end |