瀏覽代碼

safe check

Unknwon 9 年之前
父節點
當前提交
67ced4aaca
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      models/migrations/migrations.go

+ 6 - 0
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)