Browse Source

Merge pull request #821 from phsmit/fix_819

Fix #819 by fetching the repository from db before updating
tags/v1.2.0-rc1
无闻 11 years ago
parent
commit
2c27160655
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      models/repo.go

+ 5
- 0
models/repo.go View File

@@ -504,6 +504,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)


Loading…
Cancel
Save