diff options
author | Nihad Abbasov <narkoz.2008@gmail.com> | 2012-08-01 16:48:15 +0400 |
---|---|---|
committer | Nihad Abbasov <narkoz.2008@gmail.com> | 2012-08-01 16:48:15 +0400 |
commit | 853ca74620734bb3cfc540e9bf96bfed4f282014 (patch) | |
tree | 1a8e34d1abc37d2cafd40ece9dd14c4611ad3be8 /lib | |
parent | 00b280c3f9521f3e001b2ffc8a8a52f2a93a69d9 (diff) |
fix typo according to docs and tests
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 0341facf9f8..8556548a856 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -37,11 +37,11 @@ module Gitlab # # Parameters: # id (required) - The ID or code name of a project - # branch_id (required) - The name of the branch + # branch (required) - The name of the branch # Example Request: - # GET /projects/:id/repository/branches/:branch_id - get ":id/repository/branches/:branch_id" do - @branch = user_project.repo.heads.find { |item| item.name == params[:branch_id] } + # GET /projects/:id/repository/branches/:branch + get ":id/repository/branches/:branch" do + @branch = user_project.repo.heads.find { |item| item.name == params[:branch] } present @branch, :with => Entities::RepoObject end @@ -148,7 +148,7 @@ module Gitlab # # Parameters: # id (required) - The ID or code name of a project - # sha (required) - The commit or branch name + # sha (required) - The commit or branch name # filepath (required) - The path to the file to display # Example Request: # GET /projects/:id/repository/commits/:sha/blob @@ -157,10 +157,10 @@ module Gitlab commit = user_project.commit ref error!('404 Commit Not Found', 404) unless commit - + tree = Tree.new commit.tree, user_project, ref, params[:filepath] error!('404 File Not Found', 404) unless tree.try(:tree) - + if tree.text? encoding = Gitlab::Encode.detect_encoding(tree.data) content_type encoding ? "text/plain; charset=#{encoding}" : "text/plain" |