gitlab-org--gitlab-foss/spec/lib/gitlab
Rémy Coutable 8bdb5b6aec Merge branch '1548-average-commits-per-day' into 'master'
Fix: Infinity Bug in Commit Statistics

## What does this MR do?

It fixes a logic bug in the commits statistics: The code assumed that the amount of days involved in a commit range is equal to the difference between the first and last date. This is not true, though, as (from a human standpoint), a commit yesterday and a commit today involve two days, not one. Similarly, a fresh project with only commits made today already 'used' one day.

Since the number of involved days used to be zero for new projects, the result for commits per day quite often amounted to `Infinity`…

## Are there points in the code the reviewer needs to double check?

The test file. I hope it is up to the standards of GitLab.

## Why was this MR needed?

The bug occurres especially for new users with their first project while exploring GitLab.

## What are the relevant issue numbers?

This bug was reported as #1548.

## Screenshots (if relevant)

See merge request !4231
2016-07-08 15:20:22 +00:00
..
backend
badge
bitbucket_import
ci Merge branch 'refactor/ci-config-move-global-entries' into 'master' 2016-07-05 08:37:16 +00:00
database
diff Add tests for Position 2016-07-06 18:51:01 -04:00
email
fogbugz_import Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
gfm
git Improve the error message displayed when branch creation fails. 2016-07-05 11:05:16 +05:30
github_import Rename MergeRequest methods that return commits or shas to be more clear and consistent 2016-07-06 18:50:58 -04:00
gitlab_import
gitorious_import
google_code_import Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
graphs
import_export Rename MergeRequest methods that return commits or shas to be more clear and consistent 2016-07-06 18:50:58 -04:00
ldap Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
lfs
metrics RailsCache metrics now includes fetch_hit/fetch_miss and read_hit/read_miss info. 2016-07-05 12:28:06 +02:00
middleware
o_auth Merge branch 'master' into dev-master 2016-07-02 22:58:21 +02:00
saml Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
sanitizers
sherlock
sql
template
akismet_helper_spec.rb
asciidoc_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
auth_spec.rb
award_emoji_spec.rb Fix emoji paths in relative root configurations 2016-07-01 09:10:12 -07:00
blame_spec.rb
build_data_builder_spec.rb
closing_issue_extractor_spec.rb
color_schemes_spec.rb
current_settings_spec.rb
database_spec.rb
exclusive_lease_spec.rb
git_access_spec.rb Revert back to not defining a default Git access protocol. 2016-07-05 16:54:22 -05:00
git_access_wiki_spec.rb Rename ENV['PROTOCOL'] to ENV['GL_PROTOCOL'] to conform to what GitLab Shell expects and make the protocol param in GitAccess mandatory. 2016-07-05 16:54:22 -05:00
highlight_spec.rb
incoming_email_spec.rb
key_fingerprint_spec.rb
lazy_spec.rb
markup_helper_spec.rb
metrics_spec.rb
note_data_builder_spec.rb Add DiffNote model 2016-07-06 18:50:59 -04:00
popen_spec.rb
project_search_results_spec.rb
push_data_builder_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
reference_extractor_spec.rb
regex_spec.rb
search_results_spec.rb
snippet_search_results_spec.rb
themes_spec.rb
upgrader_spec.rb
uploads_transfer_spec.rb
url_builder_spec.rb Add DiffNote model 2016-07-06 18:50:59 -04:00
url_sanitizer_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
version_info_spec.rb
workhorse_spec.rb