summaryrefslogtreecommitdiff
path: root/app/controllers/projects
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-01 17:00:28 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-01 17:00:28 +0300
commitae9dd6276267e0df2d9c2da3b89393e4ee212175 (patch)
tree4db4314bd54eda3bce6b3c67b719f1f5097fb68a /app/controllers/projects
parente219cf7246c6a0495e4507deaffeba11e79f13b8 (diff)
downloadgitlab-ce-ae9dd6276267e0df2d9c2da3b89393e4ee212175.tar.gz
Update code to work with gitlab_git 3
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/blame_controller.rb2
-rw-r--r--app/controllers/projects/blob_controller.rb2
-rw-r--r--app/controllers/projects/raw_controller.rb4
-rw-r--r--app/controllers/projects/refs_controller.rb3
-rw-r--r--app/controllers/projects/tree_controller.rb2
5 files changed, 8 insertions, 5 deletions
diff --git a/app/controllers/projects/blame_controller.rb b/app/controllers/projects/blame_controller.rb
index e58b4507202..f22c6497cbf 100644
--- a/app/controllers/projects/blame_controller.rb
+++ b/app/controllers/projects/blame_controller.rb
@@ -8,7 +8,7 @@ class Projects::BlameController < Projects::ApplicationController
before_filter :require_non_empty_project
def show
- @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path)
+ @blob = Gitlab::Git::Blob.find(@repository, @commit.id, @path)
@blame = Gitlab::Git::Blame.new(project.repository, @commit.id, @path)
end
end
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index b1329c01ce7..33dbc869996 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -8,6 +8,6 @@ class Projects::BlobController < Projects::ApplicationController
before_filter :require_non_empty_project
def show
- @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path)
+ @blob = Gitlab::Git::Blob.find(@repository, @commit.id, @path)
end
end
diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb
index 0c23d411f4c..8633b225b64 100644
--- a/app/controllers/projects/raw_controller.rb
+++ b/app/controllers/projects/raw_controller.rb
@@ -8,9 +8,9 @@ class Projects::RawController < Projects::ApplicationController
before_filter :require_non_empty_project
def show
- @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path)
+ @blob = Gitlab::Git::Blob.find(@repository, @commit.id, @path)
- if @blob.exists?
+ if @blob
type = if @blob.mime_type =~ /html|javascript/
'text/plain; charset=utf-8'
else
diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb
index e5c090e1f4d..16621c0371e 100644
--- a/app/controllers/projects/refs_controller.rb
+++ b/app/controllers/projects/refs_controller.rb
@@ -24,13 +24,14 @@ class Projects::RefsController < Projects::ApplicationController
format.js do
@ref = params[:ref]
define_tree_vars
+ tree
render "tree"
end
end
end
def logs_tree
- contents = @tree.entries
+ contents = tree.entries
@logs = contents.map do |content|
file = params[:path] ? File.join(params[:path], content.name) : content.name
last_commit = @repo.commits(@commit.id, file, 1).last
diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb
index 5d543f35665..1150efbea9d 100644
--- a/app/controllers/projects/tree_controller.rb
+++ b/app/controllers/projects/tree_controller.rb
@@ -8,6 +8,8 @@ class Projects::TreeController < Projects::ApplicationController
before_filter :require_non_empty_project
def show
+ return not_found! if tree.entries.empty?
+
respond_to do |format|
format.html
# Disable cache so browser history works