fix(mirror): add user missing from context
Noel
created 1 year ago
DeleteRepository, called when mirroring fails, requires access to the
user. The user isn't included in the context for the task, so attach
the closed over user to the task context.
Change summary
pkg/backend/repo.go | 2 ++
1 file changed, 2 insertions(+)
Detailed changes
@@ -116,6 +116,8 @@ func (d *Backend) ImportRepository(_ context.Context, name string, user proto.Us
repoc := make(chan proto.Repository, 1)
d.logger.Info("importing repository", "name", name, "remote", remote, "path", rp)
d.manager.Add(tid, func(ctx context.Context) (err error) {
+ ctx = proto.WithUserContext(ctx, user)
+
copts := git.CloneOptions{
Bare: true,
Mirror: opts.Mirror,