diff --git a/src/Tgstation.Server.Host/Controllers/RepositoryController.cs b/src/Tgstation.Server.Host/Controllers/RepositoryController.cs index 111146ca9e..034ba36ffb 100644 --- a/src/Tgstation.Server.Host/Controllers/RepositoryController.cs +++ b/src/Tgstation.Server.Host/Controllers/RepositoryController.cs @@ -175,7 +175,12 @@ namespace Tgstation.Server.Host.Controllers if (repos == null) throw new JobException("Filesystem conflict while cloning repository!"); var db = serviceProvider.GetRequiredService(); - if (await PopulateApi(api, repos, db, Instance, ct).ConfigureAwait(false)) + var instance = new Models.Instance + { + Id = Instance.Id + }; + db.Instances.Attach(instance); + if (await PopulateApi(api, repos, db, instance, ct).ConfigureAwait(false)) await db.Save(ct).ConfigureAwait(false); } }, cancellationToken).ConfigureAwait(false);