[PR #2803] [MERGED] Fix Git LFS object/repo link storage in database and small refactoring #16601

Closed
opened 2025-11-02 12:14:24 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2803
Author: @lafriks
Created: 10/29/2017
Status: Merged
Merged: 10/30/2017
Merged by: @lunny

Base: masterHead: fix/lfs_object_right_check


📝 Commits (2)

  • 395f4a8 Fix Git LFS object/repo link storage in database and small refactoring
  • c8d6ff6 Merge branch 'master' into fix/lfs_object_right_check

📊 Changes

2 files changed (+38 additions, -59 deletions)

View changed files

📝 models/lfs.go (+4 -5)
📝 modules/lfs/server.go (+34 -54)

📄 Description

Currently if same file is stored in multiple repositories only link between first LFS object and repository id is saved in gitea database this way if user has access to only other repositories it is not possible for him to fetch such files. This PR fixes that all LFS object and repository links are stored correctly.

Also if deleting first repository (that only has link between LFS object and repo saved) file from disk will be removed even if that is also used in other repositories so this can lead to serious data loss.

Fixes only partly #2796 - new links will be saved correctly. For previously uploaded LFS objects there needs to be created migration but that can be done in other PR.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2803 **Author:** [@lafriks](https://github.com/lafriks) **Created:** 10/29/2017 **Status:** ✅ Merged **Merged:** 10/30/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `fix/lfs_object_right_check` --- ### 📝 Commits (2) - [`395f4a8`](https://github.com/go-gitea/gitea/commit/395f4a89fb117b7aca7e8a9889537d833e3daad0) Fix Git LFS object/repo link storage in database and small refactoring - [`c8d6ff6`](https://github.com/go-gitea/gitea/commit/c8d6ff61917bee98c9f19915e2383457afcd87da) Merge branch 'master' into fix/lfs_object_right_check ### 📊 Changes **2 files changed** (+38 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `models/lfs.go` (+4 -5) 📝 `modules/lfs/server.go` (+34 -54) </details> ### 📄 Description Currently if same file is stored in multiple repositories only link between first LFS object and repository id is saved in gitea database this way if user has access to only other repositories it is not possible for him to fetch such files. This PR fixes that all LFS object and repository links are stored correctly. Also if deleting first repository (that only has link between LFS object and repo saved) file from disk will be removed even if that is also used in other repositories so this can lead to serious data loss. Fixes only partly #2796 - new links will be saved correctly. For previously uploaded LFS objects there needs to be created migration but that can be done in other PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:14:24 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16601