MRs lose track of merged+deleted branches

Summary

Merging a feature branch with git-flow-avh's git flow feature finish FOO does not correctly close the associated merge request. This is on gitlab.com.

git flow feature finish does the following:

Summary of actions:
- The feature branch 'feature/foo' was merged into 'devel'
- Feature branch 'feature/foo' has been locally deleted; it has been remotely deleted from 'origin'
- You are now on branch 'devel'

At this point the MR reads "Source branch does not exist. Please restore the source branch or use a different source branch.". This is normal and expected.

However, if I push the merge commit with git push, the MR does not get updated. On our locally hosted Gitlab (GitLab 7.3.2 gitlab-ce@f092e53ee943aaf19b5febfca3ba8d3860ae1700), this does work: the MR is successfully merged once devel is pushed.

If I set feature.finish.keepremote so that the remote is not deleted when I finish the feature, the MR is successfully merged once devel is pushed.

Steps to reproduce

  • Create a feature branch on a repository, with some commits
  • Create an MR from the feature branch
  • Merge the branch locally
  • Delete the branch remotely
  • Push the merge

Example Project

fgabolde/gitlab-merge-requests-bug!1 (closed)

What is the current bug behavior?

The MR status reads: "Source branch does not exist. Please restore the source branch or use a different source branch."

MR close hooks do not fire.

What is the expected correct behavior?

The MR status should read: "The changes were merged into devel. The source branch has been removed."

MR close hooks should fire.

Output of checks

This bug happens on GitLab.com

Edited Jun 18, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading