Skip to content

Fix submodule link to then project under subgroup

username-removed-444 requested to merge dz-fix-submodule-subgroup into master

What does this MR do?

Fixes submodule link to the project under subgroup.

Why was this MR needed?

Make submodule links to nested projects work same as normal one.

Before this change, only last namespace in full path was extracted. It's fine unless you have a link to submodule under subgroups. In that case self_url? method returns false and a link is processed as external. I could not find a proper regex to cover all cases and correctly extract full path to the repository and instead used current instance hostname to get correct path to namespace and project.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Fixes https://gitlab.com/gitlab-org/gitlab-ee/issues/2411

Edited by username-removed-444

Merge request reports