lib/gitlab/regex.rb: default_regex doesn't allow a preceding dot in filenames
Created by: wKovacs64
Scenario:
Try to use the (+) plus sign to add a file to a project. Enter a filename that begins with a period (example: .gitignore
). Fill out the other fields and try to commit.
Expected Result: Valid commit.
Actual Result: Receive an error stating "Your changes could not be commited, because file name contains not allowed characters" and no commit is made.
Possible Solution: It seems fixable by changing the regex to the following:
\A[\.a-zA-Z0-9][a-zA-Z0-9_\-\.]*(?<!\.git)\z
Unfortunately, this may allow for undesired filenames such as ..
so someone with more regex experience may want to evaluate.