diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2018-03-01 22:33:29 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-03-01 22:33:29 +0000 |
commit | b112a33b98c657b1d2838c14d598a291a14565e0 (patch) | |
tree | a37cc22491baf419a15b81918ee07c2fd0d8f2da /lib/api/commits.rb | |
parent | 4441ca4ba7bf6c4a68574d018d2bf48e45326654 (diff) | |
parent | 5c4eace67f188da436b3b380a0125d053b29422a (diff) | |
download | gitlab-ce-sentiment-analysis.tar.gz |
Merge branch 'master' into 'sentiment-analysis'sentiment-analysis
# Conflicts:
# app/assets/javascripts/notes/components/comment_form.vue
Diffstat (limited to 'lib/api/commits.rb')
-rw-r--r-- | lib/api/commits.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb index 3d6e78d2d80..982f45425a3 100644 --- a/lib/api/commits.rb +++ b/lib/api/commits.rb @@ -18,25 +18,28 @@ module API optional :since, type: DateTime, desc: 'Only commits after or on this date will be returned' optional :until, type: DateTime, desc: 'Only commits before or on this date will be returned' optional :path, type: String, desc: 'The file path' + optional :all, type: Boolean, desc: 'Every commit will be returned' use :pagination end get ':id/repository/commits' do path = params[:path] before = params[:until] after = params[:since] - ref = params[:ref_name] || user_project.try(:default_branch) || 'master' + ref = params[:ref_name] || user_project.try(:default_branch) || 'master' unless params[:all] offset = (params[:page] - 1) * params[:per_page] + all = params[:all] commits = user_project.repository.commits(ref, path: path, limit: params[:per_page], offset: offset, before: before, - after: after) + after: after, + all: all) commit_count = - if path || before || after - user_project.repository.count_commits(ref: ref, path: path, before: before, after: after) + if all || path || before || after + user_project.repository.count_commits(ref: ref, path: path, before: before, after: after, all: all) else # Cacheable commit count. user_project.repository.commit_count_for_ref(ref) |