Skip to content

Re-add the feature of swapping branches on Compare view

Summary

This button was removed in this issue > #14615 (comment 493733369)

Let's reintroduce this button per this updated mock. The functionality was unclear in the original as noted in the above issue comment. So let's figure out what's the expected behaviour of this button 👍

image


Old description

Swapping branches on comparison page doesn't work as expected

Summary

When starting the branch comparison process, after selecting a branch, then clicking the swap button, the page reloads and resets the source and target branches to master.

compare-issue

What's expected

I expect the swap icon to swap the source and target branch, regardless of whether or not you're actively comparing branches.

Steps to reproduce

  1. Enter the comparison page: https://gitlab.com/gitlab-org/gitlab/-/compare?from=master&to=master
  2. Select a branch other than master in the source dropdown
  3. Click Swap revision icon to swap the source and target branches.
Edited by André Luís