Expand 'Related Branch' detection
### Problem to solve It will give Gitlab the ability to detect related branches inside subtrees. This is intended to anyone who's using subtrees to separate different development characteristics. Ex: Most of the projects where I work at, are using this structure. ![image](/uploads/8fc732f49ec119ac85021694e481e67d/image.png) It would be nice to automatically relate those to an issue like this. ![image](/uploads/2460b8a1acd3900729e33e83e80a04b5/image.png) ### Proposal <!-- How are we going to solve the problem? Try to include the user journey! https://about.gitlab.com/handbook/journeys/#user-journey --> To accomplish that, I modified this file: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/services/issues/related_branches_service.rb#L22 Replacing this `branch =~ /\A#{issue.iid}-(?!\d+-stable)/i` by `branch =~ /\A.*\/*#{issue.iid}-(?!\d+-stable)/i` I haven't notice any weird behaviour inside my Gitlab Instance. If it ok/required I would send a MR with the change ### Links / references * gitlab-foss#48928 * gitlab-foss#14910 * https://gitlab.com/gitlab-org/gitlab-foss/issues/14910#note_151219610
issue