From 06e70bee3ffe8744b389ddeb97ab560f1038073d Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Thu, 20 Sep 2018 11:25:29 -0400 Subject: [PATCH] Immediately try to delete the temporary branch after pushing --- .../Components/Repository/Repository.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Components/Repository/Repository.cs b/src/Tgstation.Server.Host/Components/Repository/Repository.cs index 9f8ec89daa..66845fc093 100644 --- a/src/Tgstation.Server.Host/Components/Repository/Repository.cs +++ b/src/Tgstation.Server.Host/Components/Repository/Repository.cs @@ -369,7 +369,10 @@ namespace Tgstation.Server.Host.Components.Repository var remote = repository.Network.Remotes.First(); try { - repository.Network.Push(remote, String.Format(CultureInfo.InvariantCulture, "+{0}:{0}", branch.CanonicalName), GeneratePushOptions(progressReporter, username, password, cancellationToken)); + var forcePushString = String.Format(CultureInfo.InvariantCulture, "+{0}:{0}", branch.CanonicalName); + repository.Network.Push(remote,forcePushString, GeneratePushOptions(progress => progressReporter((int)(0.9f * progress)), username, password, cancellationToken)); + var removalString = String.Format(CultureInfo.InvariantCulture, ":{0}", branch.CanonicalName); + repository.Network.Push(remote, removalString, GeneratePushOptions(progress => progressReporter(90 + (int)(0.1f * progress)), username, password, cancellationToken)); } catch (UserCancelledException) {