aboutsummaryrefslogtreecommitdiffstats
path: root/models/db/context.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-10-13 20:47:02 +0100
committerGitHub <noreply@github.com>2021-10-13 20:47:02 +0100
commit5a8dd96b33ac6e91a5c40fc4ef867625ca6ec88e (patch)
tree5b57df8b2b234382f438015348f201f96f264c7f /models/db/context.go
parent01b9d35f1a0188dadc1ee09f5e4dd98acc38ff09 (diff)
downloadgitea-5a8dd96b33ac6e91a5c40fc4ef867625ca6ec88e.tar.gz
gitea-5a8dd96b33ac6e91a5c40fc4ef867625ca6ec88e.zip
Ensure that git daemon export ok is created for mirrors (#17243)
* Ensure that git daemon export ok is created for mirrors There is an issue with #16508 where it appears that create repo requires that the repo does not exist. This causes #17241 where an error is reported because of this. This PR fixes this and also runs update-server-info for mirrors and generated repos. Fix #17241 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'models/db/context.go')
-rw-r--r--models/db/context.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/db/context.go b/models/db/context.go
index 0037bb198d..62b77bc72f 100644
--- a/models/db/context.go
+++ b/models/db/context.go
@@ -31,6 +31,14 @@ type Context struct {
e Engine
}
+// WithEngine returns a db.Context from a context.Context and db.Engine
+func WithEngine(ctx context.Context, e Engine) *Context {
+ return &Context{
+ Context: ctx,
+ e: e,
+ }
+}
+
// Engine returns db engine
func (ctx *Context) Engine() Engine {
return ctx.e