Git LFS objects display with LFS flag, but render as the underlying LFS pointer file
Summary
In trying to reproduce another issue, I found that I couldn't push a XML file as an LFS object, and have it display properly in the UI as LFS.
I have also reproduced it with TXT files, same example project details in comment.
- It shows with the
LFS
flag - in the file listing view, and when viewing the file. - The content of the file shows as a pointer file - rather than either rendering the file or indicating it can't be rendered
- Cloning the project shows the files to be LFS
Steps to reproduce
git clone https://gitlab.com/bprescott-support/testing/zd337093-lfs foo
cd foo
rm -rf .git
git init .
git add .gitattributes README.md sample1.arxml sample1.xml
git commit -m 'init'
git remote add origin <projectURL>
git push -u origin HEAD
Example Project
https://gitlab.com/bprescott-support/testing/zd337093-lfs
What is the current bug behavior?
LFS objects behave inconsistently, including rendering the git-controlled pointer file.
What is the expected correct behavior?
LFS objects should behave as LFS objects in the UI
Relevant logs and/or screenshots
-
Look at the sample project - https://gitlab.com/bprescott-support/testing/zd337093-lfs
-
There's two LFS files. They're the same file, but the
.xml
file is missing three lines (so the SHA is different) and the file extension is different. -
View the
.arxml
file. Expected LFS behaviour. -
View the
.xml
file. Not expected -
Did I source control a pointer file as a LFS object? No, I didn't. Both files are 1.3MB:
$ git clone https://gitlab.com/bprescott-support/testing/zd337093-lfs zd337093-lfs-second [snip] $ cd zd337093-lfs-second $ ls -alh total 327K drwxrwxr-x 3 ben ben 7 Nov 22 16:09 . drwxr-xr-x 37 ben ben 37 Nov 22 16:09 .. drwxrwxr-x 9 ben ben 14 Nov 22 16:09 .git -rw-rw-r-- 1 ben ben 170 Nov 22 16:09 .gitattributes -rw-rw-r-- 1 ben ben 565 Nov 22 16:09 README.md -rw-rw-r-- 1 ben ben 1.3M Nov 22 16:09 sample1.arxml -rw-rw-r-- 1 ben ben 1.3M Nov 22 16:09 sample1.xml $ git-lfs ls-files -l -s d812eb57acc7f2fb6caf9b4b916ac85c5017c9210317017de2d15fb7c76e1be4 * sample1.arxml (1.3 MB) cb58760550b5a877445c7259cfb2a6be85bf3ff2b98ef040f408a641c4686271 * sample1.xml (1.3 MB)
-
View the commit
- The XML file is explicitly stating that it's stored as LFS.
- Why does it show like this, and not as
File added
like the other file?
Output of checks
This bug happens on GitLab.com - GitLab Enterprise Edition 15.7.0-pre 5be5b955