Skip to content

Merge request tabs don't render when no commits available

Summary

If a merge request is created in which there are no new commits to display (for instance on a newly created branch), the usual merge request tabs will not appear. These are still valuable to view associated notes such as when tags were added and removed, or writing comments.

Steps to reproduce

  1. Create a new branch by clicking "New Branch" within an issue which doesn't yet have a corresponding branch.
  2. On the next page, click "Create Merge Request" next to where is says "you pushed to XXX just now"
  3. Save the new merge request
  4. View the newly created merge request

Expected behavior

The merge request should have a discussions tab and perhaps a changes tab in which an empty state similar to the merge request preview is shown:

Screen_Shot_2016-12-28_at_8.27.19_AM_copy

Actual behavior

The merge request has no tabs available, and notes/discussion history is inaccessible.

Screen_Shot_2016-12-28_at_8.27.39_AM_copy

Relevant logs and/or screenshots

reproduced on GitLab.com

Possible fixes

Remove the logic which causes the tabs to not render when there are zero commits to show.