Skip to content

Changes count is inconsistent

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Background

When base and HEAD diff of a MR has differences (e.g. base diff contains 2 files, HEAD diff contains 1 file), the count shown on the "Changes" tab when the MR page loads will be different once user views the "Changes" tab.

Example MR: patrickbajao/verification!88.

Proposal

Modify Projects::MergeRequestsController#get_diffs_count to get the diff_size of MergeRequest#merge_head_diff.

We have to ensure we only do so if we're actually showing HEAD diff on the changes tab as well because it can show incorrect count for a moment if they're not consistent. We can use the same checks in this code except for the diff_head param check as we don't pass that when we load the MR page.

Edited by 🤖 GitLab Bot 🤖