diff options
author | Unknwon <u@gogs.io> | 2015-10-31 23:25:08 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-10-31 23:25:08 -0400 |
commit | 67ced4aaca5f70a6806f9af394645ceda7ff0fac (patch) | |
tree | e091f2051dbc0fb22ad1478723d59d4b0827a762 /models | |
parent | 04806b614e64619828abc6e37b83659304323e7e (diff) | |
download | gitea-67ced4aaca5f70a6806f9af394645ceda7ff0fac.tar.gz gitea-67ced4aaca5f70a6806f9af394645ceda7ff0fac.zip |
safe check
Diffstat (limited to 'models')
-rw-r--r-- | models/migrations/migrations.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index df1e4a2d2e..d7549d07fa 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -684,6 +684,12 @@ func cleanUpMigrateRepoInfo(x *xorm.Engine) (err error) { } configPath := filepath.Join(setting.RepoRootPath, user.LowerName, repo.LowerName+".git/config") + + // In case repository file is somehow missing. + if !com.IsFile(configPath) { + continue + } + cfg, err := ini.Load(configPath) if err != nil { return fmt.Errorf("open config file: %v", err) |