Reopening an old closed MR silently throws away the commits
Summary
Reopening an MR that has been closed for long enough that refs/merge-requests/NNNN/head has been deleted, and for which the source branch has also been deleted, succeeds but silently and unexpectedly changes the MR to contain zero commits, losing the ability to even look at the diffs which was possible prior to the reopen.
Steps to reproduce
- Create a merge request with some commits in the source branch.
- Close the merge request.
- Delete the source branch.
- Wait 14 days so that
refs/merge-request/NNNN/headis deleted. - Reopen the merge request.
What is the current bug behavior?
The reopen button immediately reopens the merge request, which then claims to have no commits or changes.
What is the expected correct behavior?
Either:
- If the commits still exist as Git objects, recreate
refs/merge-requests/NNNN/headand retain the commits in the MR. - If the commits no longer exist as Git objects, but only as something in the web UI (they are still there, you can still see the commits and diffs in the web UI!), then show a warning that reopening the MR will lose that information, apparently forever.
Edited by 🤖 GitLab Bot 🤖