LFS files no longer render #10001

Closed
opened 2025-11-02 08:55:22 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @kousu on GitHub (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

Originally created by @kousu on GitHub (Dec 20, 2022). ### Description #22042 seems to have broken display of LFS files. <details><summary>Build previous</summary> ``` $ 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 ``` </details> 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](https://user-images.githubusercontent.com/987487/208786714-78d1b3c9-4b8f-4be0-a4bd-6c85896377ca.png) ![Screenshot 2022-12-20 at 18-32-09 test](https://user-images.githubusercontent.com/987487/208786717-cf87aead-2fa2-4d01-85c7-da4b2388b774.png) <details><summary>Build next</summary> ``` $ 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 ``` </details> 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](https://user-images.githubusercontent.com/987487/208786793-f405bbef-28f8-411e-bfbd-6179a43e83d4.png) ![Screenshot 2022-12-20 at 18-35-01 test](https://user-images.githubusercontent.com/987487/208786795-dad02c62-2cac-429b-b81c-349e3ca938bb.png) ### 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
GiteaMirror added the type/bug label 2025-11-02 08:55:22 -06:00
Author
Owner

@kousu commented on GitHub (Dec 20, 2022):

https://github.com/go-gitea/gitea/pull/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 commented on GitHub (Dec 20, 2022): https://github.com/go-gitea/gitea/pull/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 :+1: :+1: :+1: 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.
Author
Owner

@kousu commented on GitHub (Dec 21, 2022):

By the way, I tried to reproduce on try.gitea.io, but I hit a different bug: https://github.com/go-gitea/gitea/issues/22194

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

@kousu commented on GitHub (Dec 21, 2022): By the way, I tried to reproduce on try.gitea.io, but I hit a different bug: https://github.com/go-gitea/gitea/issues/22194 I'm confident if I could test it, I would see the same result.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10001