Commit 853ca74620734bb3cfc540e9bf96bfed4f282014

Authored by Nihad Abbasov
1 parent 00b280c3

fix typo according to docs and tests

Showing 1 changed file with 7 additions and 7 deletions   Show diff stats
lib/api/projects.rb
... ... @@ -37,11 +37,11 @@ module Gitlab
37 37 #
38 38 # Parameters:
39 39 # id (required) - The ID or code name of a project
40   - # branch_id (required) - The name of the branch
  40 + # branch (required) - The name of the branch
41 41 # Example Request:
42   - # GET /projects/:id/repository/branches/:branch_id
43   - get ":id/repository/branches/:branch_id" do
44   - @branch = user_project.repo.heads.find { |item| item.name == params[:branch_id] }
  42 + # GET /projects/:id/repository/branches/:branch
  43 + get ":id/repository/branches/:branch" do
  44 + @branch = user_project.repo.heads.find { |item| item.name == params[:branch] }
45 45 present @branch, :with => Entities::RepoObject
46 46 end
47 47  
... ... @@ -148,7 +148,7 @@ module Gitlab
148 148 #
149 149 # Parameters:
150 150 # id (required) - The ID or code name of a project
151   - # sha (required) - The commit or branch name
  151 + # sha (required) - The commit or branch name
152 152 # filepath (required) - The path to the file to display
153 153 # Example Request:
154 154 # GET /projects/:id/repository/commits/:sha/blob
... ... @@ -157,10 +157,10 @@ module Gitlab
157 157  
158 158 commit = user_project.commit ref
159 159 error!('404 Commit Not Found', 404) unless commit
160   -
  160 +
161 161 tree = Tree.new commit.tree, user_project, ref, params[:filepath]
162 162 error!('404 File Not Found', 404) unless tree.try(:tree)
163   -
  163 +
164 164 if tree.text?
165 165 encoding = Gitlab::Encode.detect_encoding(tree.data)
166 166 content_type encoding ? "text/plain; charset=#{encoding}" : "text/plain"
... ...