mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-21 05:28:00 +02:00
Respect LFS File Lock on UI (#8719)
* update #8687 respect file locking * upate #8687 Add LFS locker information * update #8719 enhance coding style and return error
This commit is contained in:
@ -2810,3 +2810,19 @@ func (repo *Repository) GetOriginalURLHostname() string {
|
||||
|
||||
return u.Host
|
||||
}
|
||||
|
||||
// GetTreePathLock returns LSF lock for the treePath
|
||||
func (repo *Repository) GetTreePathLock(treePath string) (*LFSLock, error) {
|
||||
if setting.LFS.StartServer {
|
||||
locks, err := GetLFSLockByRepoID(repo.ID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, lock := range locks {
|
||||
if lock.Path == treePath {
|
||||
return lock, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user