diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-10 09:59:54 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-10 09:59:54 +0000 |
commit | 476cd0f7638df222fec3487a2d5fbc6129139bdc (patch) | |
tree | 47ebde084ec6326e17405d4d2b024d81a4f4ec37 | |
parent | 8e5a0b6e92b3439e2a7fb20456f238c39dcc590d (diff) | |
parent | 62e523f4f4db67e3792980c4b56473f86c7c5e91 (diff) | |
download | gitlab-ce-476cd0f7638df222fec3487a2d5fbc6129139bdc.tar.gz |
Merge branch 'commit-count' into 'master'
Project commit count for default branch
Currently, the commit count displayed on a project's home page shows the total number of commits on the master branch. This can lead to situations in which a project may have no commits reported or very few if the project workflow does not involve the use of a branch named "master". Since number of commits can be an indicator of project health, showing 0 commits could make it harder to encourage adoption of a project.
This MR alters the repository model's `commit_count` method to return the count for the default branch instead of master.
See issue #299
-rw-r--r-- | app/models/repository.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index b7239236aea..f6e44a52485 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -106,7 +106,7 @@ class Repository def commit_count Rails.cache.fetch(cache_key(:commit_count)) do begin - raw_repository.raw.commit_count + raw_repository.raw.commit_count(self.root_ref) rescue 0 end |