Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix LFS file not stored in LFS when uploaded/edited via API or web UI #34367

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bytedream
Copy link
Contributor

@bytedream bytedream commented May 4, 2025

Files that should be stored in LFS and are uploaded/edited from the API or web UI aren't stored in LFS. This may be a regression from #34154.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 4, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label May 4, 2025
@bytedream bytedream changed the title Fix file not stored in LFS when uploaded/edited via API or web UI Fix LFS file not stored in LFS when uploaded/edited via API or web UI May 4, 2025
@bytedream
Copy link
Contributor Author

Differences between 1.23.7 and 1.24.0-rc0 / current main. Same repository, lfs works fine when pushed with git on both versions, uploading a file via web UI that is then stored in lfs according to .gitattributes only works in 1.23.7.

.gitattributes
gitattrs

1.23.7 (stored in lfs)
1_23_7

1.24.0-rc0 / current main (not stored in lfs)
1_24_0_rc0

image

@lunny
Copy link
Member

lunny commented May 7, 2025

Take a look at the original implementation. It will read the git worktree rather than a HEAD branch directly. https://github.com/go-gitea/gitea/pull/34154/files#diff-eb96c4920cd1cce828a016dc1acdbf3cd320109a1c6c08f0ec5ac411c57cdc3c

PASSing HEAD will create a new temporory repository if git is lower than 2.40.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants