Skip to content

LFS files no longer render #22193

Closed
@kousu

Description

@kousu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions