summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/repo.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index ac3443f895..7945cb309d 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -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
+}