summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/migrations/migrations.go6
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)