Commit 6cec9ed3283a611a40b6df981ed00ccaa1bd0e73

Authored by Saito
1 parent b664b784

linguist will take care of this

Showing 1 changed file with 4 additions and 10 deletions   Show diff stats
lib/api/projects.rb
@@ -147,7 +147,7 @@ module Gitlab @@ -147,7 +147,7 @@ module Gitlab
147 @hooks = paginate user_project.hooks 147 @hooks = paginate user_project.hooks
148 present @hooks, with: Entities::Hook 148 present @hooks, with: Entities::Hook
149 end 149 end
150 - 150 +
151 # Get a project hook 151 # Get a project hook
152 # 152 #
153 # Parameters: 153 # Parameters:
@@ -159,7 +159,7 @@ module Gitlab @@ -159,7 +159,7 @@ module Gitlab
159 @hook = user_project.hooks.find(params[:hook_id]) 159 @hook = user_project.hooks.find(params[:hook_id])
160 present @hook, with: Entities::Hook 160 present @hook, with: Entities::Hook
161 end 161 end
162 - 162 +
163 163
164 # Add hook to project 164 # Add hook to project
165 # 165 #
@@ -177,7 +177,7 @@ module Gitlab @@ -177,7 +177,7 @@ module Gitlab
177 error!({'message' => '404 Not found'}, 404) 177 error!({'message' => '404 Not found'}, 404)
178 end 178 end
179 end 179 end
180 - 180 +
181 # Update an existing project hook 181 # Update an existing project hook
182 # 182 #
183 # Parameters: 183 # Parameters:
@@ -382,13 +382,7 @@ module Gitlab @@ -382,13 +382,7 @@ module Gitlab
382 tree = Tree.new commit.tree, user_project, ref, params[:filepath] 382 tree = Tree.new commit.tree, user_project, ref, params[:filepath]
383 not_found! "File" unless tree.try(:tree) 383 not_found! "File" unless tree.try(:tree)
384 384
385 - if tree.text?  
386 - encoding = Gitlab::Encode.detect_encoding(tree.data)  
387 - content_type encoding ? "text/plain; charset=#{encoding}" : "text/plain"  
388 - else  
389 - content_type tree.mime_type  
390 - end  
391 - 385 + content_type tree.mime_type
392 present tree.data 386 present tree.data
393 end 387 end
394 388