Skip to content

Commit 1dd9c39

Browse files
committed
GH-1885 reproduction of the bug
1 parent 58739ba commit 1dd9c39

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/GitVersionCore.Tests/GitVersionExecutorTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,27 @@ public void CacheKeySameAfterReNormalizing()
7575
});
7676
}
7777

78+
[Test]
79+
public void GitPreparerShouldFailWhenTargetPathNotInitialized()
80+
{
81+
RepositoryScope((fixture, vv) =>
82+
{
83+
var targetUrl = "https://github.com/GitTools/GitVersion.git";
84+
85+
var arguments = new Arguments
86+
{
87+
TargetUrl = targetUrl,
88+
TargetPath = null
89+
};
90+
var options = Options.Create(arguments);
91+
Should.Throw<NullReferenceException>(() => new GitPreparer(log, environment, options));
92+
93+
arguments.TargetPath = fixture.RepositoryPath;
94+
95+
Should.NotThrow(() => new GitPreparer(log, environment, options));
96+
});
97+
}
98+
7899
[Test]
79100
[Category("NoMono")]
80101
[Description("LibGit2Sharp fails here when running under Mono")]

0 commit comments

Comments
 (0)