Merge branch 'master' into refactor_issues-subscription

This commit is contained in:
6543
2019-10-30 01:34:26 +01:00
committed by GitHub
6 changed files with 65 additions and 9 deletions
+16
View File
@@ -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
}