[Backport] Fix bug when migrate from API (#8631) (#9563)

* Fix bug when migrate from API (#8631)

* fix bug when migrate from API

* fix test

* fix test

* improve

* fix error message

* Update routers/api/v1/repo/repo.go

* remove unrelated

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
6543 2020-01-02 00:36:00 +01:00 committed by Lauris BH
parent c63a80138a
commit cb3fe4cbf1
4 changed files with 31 additions and 10 deletions

View file

@ -2811,3 +2811,9 @@ func (repo *Repository) GetOriginalURLHostname() string {
return u.Host
}
// UpdateRepositoryCols updates repository's columns
func UpdateRepositoryCols(repo *Repository, cols ...string) error {
_, err := x.ID(repo.ID).Cols(cols...).Update(repo)
return err
}