Commit 836c870cc9f72449befd03c994f563040ff94f69
1 parent
ae9dd627
Exists in
master
and in
4 other branches
Fix edit file
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/controllers/projects/edit_tree_controller.rb
@@ -32,9 +32,9 @@ class Projects::EditTreeController < Projects::ApplicationController | @@ -32,9 +32,9 @@ class Projects::EditTreeController < Projects::ApplicationController | ||
32 | private | 32 | private |
33 | 33 | ||
34 | def edit_requirements | 34 | def edit_requirements |
35 | - @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path) | 35 | + @blob = Gitlab::Git::Blob.find(@repository, @commit.id, @path) |
36 | 36 | ||
37 | - unless @blob.exists? && @blob.text? | 37 | + unless @blob |
38 | redirect_to project_blob_path(@project, @id), notice: "You can only edit text files" | 38 | redirect_to project_blob_path(@project, @id), notice: "You can only edit text files" |
39 | end | 39 | end |
40 | 40 |