Files uploaded to repository have spaces in names replaced with underscores
Summary
Spaces in file names are replaced with underscores, when the file is uploaded to a repo via the directory browser's "+" > "This directory" > "Upload file" dialog.
Steps to reproduce
- Go to your project's "Project > Details" or "Repository > Files" page.
- Click the "+" dropdown to the right of the current directory's name (in the directory browser's breadcrumb line).
- Select "This directory" > "Upload file".
- In the dialog that pops up, select a local file that has spaces in the name, e.g. "good cats.gif", and upload it. (Commit message doesn't matter.)
- Behold! Gitlab has uploaded a file called "good_cats.gif" instead of "good cats.gif".
Example Project
https://gitlab.com/ethanherbertson/gitlab-bug-spaces-in-filenames/
The GIF in the above project was uploaded as "good cat.gif", but GitLab silently changed it to "good_cat.gif" instead.
What is the current bug behavior?
A file named "good cat.gif" is uploaded as "good_cat.gif" instead, with no warning or confirmation.
What is the expected correct behavior?
Ideally, a file named "good cat.gif" would be uploaded as "good cat.gif".
Much less preferably, a warning should be present in the upload dialog that the spaces will be changed.
Relevant logs and/or screenshots
Output of checks
N/A
Results of GitLab environment info
Expand for output related to GitLab environment info
N/A
Results of GitLab application Check
Expand for output related to the GitLab application check
N/A
Possible fixes
N/A
Edited by 🤖 GitLab Bot 🤖

