0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-24 00:03:11 -05:00

Fix #819 by fetching the repository from db before updating

This commit is contained in:
Peter Smit 2015-01-02 11:15:42 +02:00
parent b6272d1803
commit 44fa9147b7

View file

@ -507,6 +507,11 @@ func initRepository(f string, u *User, repo *Repository, initReadme bool, repoLa
}
if len(fileName) == 0 {
// re-fetch the repository from database before updating it (else it would
// override changes that were done earlier with sql)
if _, err := x.Get(repo); err != nil {
return err
}
repo.IsBare = true
repo.DefaultBranch = "master"
return UpdateRepository(repo)