'Upload File' ignores lfs tracking rules
Summary
New files that should be tracked by git-lfs are not added to git-lfs when they are uploaded through the "Upload File" dialog in the GitLab Web Interface.
I've only tested this on GitLab 9.0.0.
Steps to reproduce
Assuming LFS is enabled for the GitLab instance.
-
Create a project
-
Add a .gitattributes file (such as the one below) to the root of the repository:
*.pdf filter=lfs diff=lfs merge=lfs -text *.pptx filter=lfs diff=lfs merge=lfs -text *.pdf filter=lfs diff=lfs merge=lfs -text *.mp4 filter=lfs diff=lfs merge=lfs -text
-
From the homepage for the project go to "Repository" -> "Files".
-
Click the '+' symbol, and select "Upload File".
-
Drag/drop or click to upload a file that matches one of the git-lfs patterns (for the example above:
example.pdf
), and commit the file. This file should be tracked by git-lfs but is not. This cannot be verified through the interface (reported https://gitlab.com/gitlab-org/gitlab-ce/issues/15567) but can be verified by cloning the repository. -
Clone the repository. Note the error:
Encountered 1 file(s) that should have been pointers, but weren't: example.pdf
-
Run
git lfs ls-files
. Output is blank demonstrating the file is not being tracked by git-lfs.
What is the current bug behavior?
Files that match the git-lfs filters are not added to git-lfs (they are committed as regular files).
What is the expected correct behavior?
If a manually uploaded file matches a git-lfs filter, it should be added to git-lfs.