From 84e729bde02a29b5eb8f17a95012e9b43f144897 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Thu, 6 Sep 2018 16:21:36 -0400 Subject: [PATCH] Fix post clone job failure --- .../Controllers/RepositoryController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Controllers/RepositoryController.cs b/src/Tgstation.Server.Host/Controllers/RepositoryController.cs index 111146ca9e..762adf0029 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 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);