Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,18 @@ public void FindsVersionInDynamicRepo(string name, string url, string targetBran
};
var options = Options.Create(gitVersionOptions);

var sp = ConfigureServices(services => services.AddSingleton(options));
// Cloning a fixed commit on a moving remote branch can transiently move HEAD during the
// intermediate normalisation steps (more likely when the machine is under load), which
// trips the HEAD-move safety check. The final state - asserted below - is what matters,
// so disable that guard for this scenario.
var environment = new TestEnvironment();
environment.SetEnvironmentVariable("IGNORE_NORMALISATION_GIT_HEAD_MOVE", "1");

var sp = ConfigureServices(services =>
{
services.AddSingleton(options);
services.AddSingleton<IEnvironment>(environment);
});

sp.DiscoverRepository();

Expand Down
Loading