mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-30 23:01:16 +08:00
safe check
This commit is contained in:
@ -684,6 +684,12 @@ func cleanUpMigrateRepoInfo(x *xorm.Engine) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configPath := filepath.Join(setting.RepoRootPath, user.LowerName, repo.LowerName+".git/config")
|
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)
|
cfg, err := ini.Load(configPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("open config file: %v", err)
|
return fmt.Errorf("open config file: %v", err)
|
||||||
|
Reference in New Issue
Block a user