Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LFS files no longer render #22193

Closed
kousu opened this issue Dec 20, 2022 · 2 comments · Fixed by #22195
Closed

LFS files no longer render #22193

kousu opened this issue Dec 20, 2022 · 2 comments · Fixed by #22195
Labels

Comments

@kousu
Copy link
Contributor

kousu commented Dec 20, 2022

Description

#22042 seems to have broken display of LFS files.

Build previous
$ git checkout 1b32ed014a61216b75d80643df53e120606ca763~
Note : basculement sur '1b32ed014a61216b75d80643df53e120606ca763~'.

Vous êtes dans l'état « HEAD détachée ». Vous pouvez visiter, faire des modifications
expérimentales et les valider. Il vous suffit de faire un autre basculement pour
abandonner les commits que vous faites dans cet état sans impacter les autres branches

Si vous voulez créer une nouvelle branche pour conserver les commits que vous créez,
il vous suffit d'utiliser l'option -c de la commande switch comme ceci :

  git switch -c <nom-de-la-nouvelle-branche>

Ou annuler cette opération avec :

  git switch -

Désactivez ce conseil en renseignant la variable de configuration advice.detachedHead à false

HEAD est maintenant sur 07461e18d Fix condition for is_internal (#22095)
$ git rev-parse HEAD
07461e18d33c78de2d6ae028f8ddba72f971db81
$ TAGS="bindata sqlite sqlite_unlock_notify" make build

I made an empty repo and uploaded two LFS files to it:

mkdir test && cd test
git init
git checkout -b main
git lfs install
git lfs track "*.md"
echo '# Testing READMEs in LFS' > README.md
echo '# Testing documents in LFS' > CONTRIBUTING.md
git add .
git commit -m "first commit"
git remote add origin kousu@localhost:kousu/test.git
git push -u origin main

With this version, LFS READMEs and LFS files render with the "Stored with Git LFS" tag:

Screenshot 2022-12-20 at 18-30-18 test
Screenshot 2022-12-20 at 18-32-09 test

Build next
$ git checkout 1b32ed014a61216b75d80643df53e120606ca763
La position précédente de HEAD était sur 07461e18d Fix condition for is_internal (#22095)
HEAD est maintenant sur 1b32ed014 remove duplicated read file code (#22042)
$ git rev-parse HEAD
1b32ed014a61216b75d80643df53e120606ca763
$ TAGS="bindata sqlite sqlite_unlock_notify" make build

After re-starting Gitea, these files no longer render; they render -as if- Gitea recognizes them as markdown, but the content shows the LFS pointer instead:

Screenshot 2022-12-20 at 18-34-27 test
Screenshot 2022-12-20 at 18-35-01 test

Gitea Version

1.19.0+dev-189-g1b32ed014

Can you reproduce the bug on the Gitea demo site?

No

Git Version

2.34.1

Operating System

Ubuntu 22.04

How are you running Gitea?

TAGS="bindata sqlite sqlite_unlock_notify" make build && ./gitea

Database

SQLite

@kousu kousu added the type/bug label Dec 20, 2022
@kousu
Copy link
Contributor Author

kousu commented Dec 20, 2022

#22042 is a really good idea! I have been eyeing that file for a few weeks now and thinking it would help me a lot if it was streamlined. So I'm 👍 👍 👍 cleaning it up. It just seems there was a small oversight. I missed it too -- getFileReader() looks like it should fall over to reading LFS content if it exists -- it's just..not.

@kousu
Copy link
Contributor Author

kousu commented Dec 21, 2022

By the way, I tried to reproduce on try.gitea.io, but I hit a different bug: #22194

I'm confident if I could test it, I would see the same result.

kousu added a commit to neuropoly/gitea that referenced this issue Dec 21, 2022
Fixup go-gitea#22042 (aka 1b32ed0).
Fixes go-gitea#22193.

Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
lunny pushed a commit that referenced this issue Dec 21, 2022
There was just a missing check.

Fixes #22193.

Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant