mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-26 22:48:20 +01:00
@@ -571,6 +571,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
progressReporter.StageName = "Copying repository";
|
||||
var resolvedOutputDirectory = ioManager.ResolvePath(outputDirectory);
|
||||
var repoOrigin = repository.Origin;
|
||||
var repoReference = repository.Reference;
|
||||
using (repository)
|
||||
await repository.CopyTo(resolvedOutputDirectory, cancellationToken);
|
||||
|
||||
@@ -585,6 +586,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
resolvedOutputDirectory,
|
||||
repoOrigin.ToString(),
|
||||
engineLock.Version.ToString(),
|
||||
repoReference,
|
||||
},
|
||||
true,
|
||||
cancellationToken);
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
EngineActiveVersionChange,
|
||||
|
||||
/// <summary>
|
||||
/// After the repo is copied, before CodeModifications are applied. Parameters: Game directory path, origin commit sha, engine version string.
|
||||
/// After the repo is copied, before CodeModifications are applied. Parameters: Game directory path, origin commit sha, engine version string, repository reference (or "(no branch)" if there is no reference).
|
||||
/// </summary>
|
||||
[EventScript("PreCompile")]
|
||||
CompileStart,
|
||||
|
||||
@@ -46,6 +46,11 @@ namespace Tgstation.Server.Host.Components.Repository
|
||||
/// </summary>
|
||||
public const string RemoteTemporaryBranchName = "___TGSTempBranch";
|
||||
|
||||
/// <summary>
|
||||
/// The value of <see cref="Reference"/> when not on a reference.
|
||||
/// </summary>
|
||||
public const string NoReference = "(no branch)";
|
||||
|
||||
/// <summary>
|
||||
/// Used when a reference cannot be determined.
|
||||
/// </summary>
|
||||
|
||||
@@ -46,6 +46,9 @@ namespace Tgstation.Server.Tests
|
||||
|
||||
const string StartSha = "af4da8beb9f9b374b04a3cc4d65acca662e8cc1a";
|
||||
await repo.CheckoutObject(StartSha, null, null, true, new JobProgressReporter(Mock.Of<ILogger<JobProgressReporter>>(), null, (stage, progress) => { }), CancellationToken.None);
|
||||
|
||||
Assert.AreEqual(Host.Components.Repository.Repository.NoReference, repo.Reference);
|
||||
|
||||
var result = await repo.CommittishIsParent("2f8588a3ca0f6b027704a2a04381215619de3412", CancellationToken.None);
|
||||
Assert.IsTrue(result);
|
||||
Assert.AreEqual(StartSha, repo.Head);
|
||||
|
||||
Reference in New Issue
Block a user