summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-11-09 06:21:00 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-11-08 17:21:00 -0500
commitf02138a1480015b9aa6ab5eef82506242d98612e (patch)
treec36279722458cd88c9146e697668b2b7c5753c18 /models
parent55bdc9aa38177f75fdae4cb96e98bf465d7ecb2a (diff)
downloadgitea-f02138a1480015b9aa6ab5eef82506242d98612e.tar.gz
gitea-f02138a1480015b9aa6ab5eef82506242d98612e.zip
Fix bug when migrate from API (#8631)
* fix bug when migrate from API * fix test * fix test * improve * fix error message
Diffstat (limited to 'models')
-rw-r--r--models/repo.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index e0a93aaebf..812460e92f 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -2840,3 +2840,9 @@ func (repo *Repository) GetTreePathLock(treePath string) (*LFSLock, error) {
}
return nil, nil
}
+
+// UpdateRepositoryCols updates repository's columns
+func UpdateRepositoryCols(repo *Repository, cols ...string) error {
+ _, err := x.ID(repo.ID).Cols(cols...).Update(repo)
+ return err
+}