Issue #34: handle worktree roots in live smoke tests
This commit is contained in:
@@ -17,4 +17,29 @@ public sealed class IntegrationTestEnvironmentTests
|
||||
"MXGATEWAY_LIVE_MXACCESS_WORKER_EXE",
|
||||
IntegrationTestEnvironment.LiveMxAccessWorkerExecutableVariableName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ResolveRepositoryRoot_AcceptsGitWorktreeFile()
|
||||
{
|
||||
string temporaryRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
|
||||
string nestedDirectory = Path.Combine(temporaryRoot, "tests", "bin");
|
||||
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(nestedDirectory);
|
||||
Directory.CreateDirectory(Path.Combine(temporaryRoot, "src"));
|
||||
File.WriteAllText(Path.Combine(temporaryRoot, ".git"), "gitdir: ../.git/worktrees/test");
|
||||
|
||||
string repositoryRoot = IntegrationTestEnvironment.ResolveRepositoryRoot(nestedDirectory);
|
||||
|
||||
Assert.Equal(temporaryRoot, repositoryRoot);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (Directory.Exists(temporaryRoot))
|
||||
{
|
||||
Directory.Delete(temporaryRoot, recursive: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user