[go: up one dir, main page]

Skip to content

Changes Tab Shows Incorrect File Count in Merge Request After Target Branch Modification

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

Summary: While working with a merge request (MR) in GitLab, I observed an inconsistency in the file change count displayed in the Changes tab. After modifying the target branch of the MR and later reverting it to the original branch, the file count in the Changes tab increased unexpectedly from 28 files to 48 files. However, after merging the MR, the actual diff in the resulting commit only included 20 files, which is the correct number. This indicates a discrepancy in how the Changes tab calculates or caches the file count.

Steps to Reproduce: Create a merge request (MR) targeting the dev branch. Verify the initial file changes in the Changes tab (e.g., 28 files). Modify the target branch to uat in the MR settings. Revert the target branch back to dev. Observe the updated file count in the Changes tab (e.g., increases to 48 files). Approve and merge the MR. Review the resulting merge commit and verify that only 20 files were actually changed. Expected Behavior: The file count displayed in the Changes tab should accurately reflect the number of files changed in the diff, even after modifying the target branch.

Observed Behavior: The Changes tab displays an inflated file change count (48 files) after modifying and reverting the target branch. The actual merge commit only includes the correct number of changes (20 files). Possible Causes: This issue might be caused by:

Diff Cache Inconsistencies: The Changes tab might not update its cached data properly after the target branch is modified and reverted. UI Rendering Issues: The displayed file count in the Changes tab may not accurately reflect the underlying diff calculation. Incorrect Diff Calculation: The diff may incorrectly include changes from the intermediate target branch (uat).

Edited by 🤖 GitLab Bot 🤖