-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Description
With a new installation with clean git repos, a newly created repo cannot be pushed to. update.log says:
2017/02/22 13:24:38 [T] pushing to 1 master
2017/02/22 13:24:38 [.../gitea/cmd/update.go:63 runUpdate()] [F] retrieve protected branches information failed
2017/02/22 13:38:26 [T] pushing to 2 lol
2017/02/22 13:38:26 [.../gitea/cmd/update.go:63 runUpdate()] [F] retrieve protected branches information failed
Adding a bit of code to update:63 to print the err != nil
shows:
2017/02/22 13:50:05 [.../gitea/cmd/update.go:63 runUpdate()] [F] retrieve protected branches information failed%!(EXTRA *pq.Error=pq: relation "protected_branch" does not exist)
This seems to be the same root cause as in #1012 -- and adding new(ProtectedBranch),
to the init() also fixes this error, and I can push.
diff --git a/models/models.go b/models/models.go
index 33268fa..0840b46 100644
--- a/models/models.go
+++ b/models/models.go
@@ -114,6 +114,8 @@ func init() {
new(TwoFactor),
new(RepoUnit),
new(RepoRedirect),
+ new(ExternalLoginUser),
+ new(ProtectedBranch),
)
gonicNames := []string{"SSL", "UID"}