-
- Downloads
Fix wrong commit count in push event payload
This fixes a regression in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20916. We now only use the full commit count for the initial push to the default branch. Otherwise, we rely on the number of commits that we calculated occurred in the push. The original behavior in 11.1.4: 1. When a new branch is pushed, `@push_commits_count` was set to the total number of refs available for the branch. 2. For other branches, `@push_commits_count` would remain `nil`. 3. `GitPushService#build_push_data` would build the push data with `@push_commits_count`. 4. If this were `nil`, it would be set to the right value here: https://gitlab.com/gitlab-org/gitlab-ce/blob/v11.1.4/lib/gitlab/data_builder/push.rb#L60 Broken behavior: 1. `GitPushService#push_commits_count` is always called. 2. The total number of commits is therefore always equal to the total number of refs available. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/49971
parent
0e9dc23d
No related branches found
No related tags found
Showing
- app/services/git_push_service.rb 10 additions, 4 deletionsapp/services/git_push_service.rb
- changelogs/unreleased/sh-fix-wrong-commit-count-in-push.yml 5 additions, 0 deletionschangelogs/unreleased/sh-fix-wrong-commit-count-in-push.yml
- spec/services/git_push_service_spec.rb 31 additions, 9 deletionsspec/services/git_push_service_spec.rb
Please register or sign in to comment