Skip to content

Fix Repository#has_ambiguous_refs? regex

Sean McGivern requested to merge fix-repository-has-ambiguous-refs into master

What does this MR do?

This regex intended to check if any refs that do not contain a slash were a prefix of a ref containing the slash, plus the slash. That is: abc is a prefix of abc/def, but not of abcd/ef.

However, the regex grouping was incorrect, and we were creating a regex like %r{^abc|def/}, which doesn't contain parentheses, and so would actually match plain abc (it wouldn't match def/).

This method was originally added in !38484 (merged). I also had a different fix in !39707 (merged), because apparently I cannot get this right 😿

For gitlab-com/gl-infra/scalability#514 (closed).

Merge request reports

Loading