Skip to content

Commit e2734f8

Browse files
committed
fixing some warnings
1 parent 012c377 commit e2734f8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/GitVersion.App/ArgumentParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private void ParseTargetPath(Arguments arguments, string? name, IReadOnlyList<st
166166
{
167167
EnsureArgumentValueCount(values);
168168
arguments.TargetPath = value;
169-
if (!this.fileSystem.DirectoryExists(value))
169+
if (string.IsNullOrWhiteSpace(value) || !this.fileSystem.DirectoryExists(value))
170170
{
171171
this.console.WriteLine($"The working directory '{value}' does not exist.");
172172
}

src/GitVersion.Core/Core/GitPreparer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ private void CreateDynamicRepository(string? targetBranch)
114114
{
115115
var gitVersionOptions = this.options.Value;
116116
var authentication = gitVersionOptions.AuthenticationInfo;
117+
if (string.IsNullOrWhiteSpace(gitDirectory))
118+
{
119+
throw new("Dynamic Git repositories should have a path specified");
120+
}
117121
if (!this.fileSystem.DirectoryExists(gitDirectory))
118122
{
119123
CloneRepository(gitVersionOptions.RepositoryInfo.TargetUrl, gitDirectory, authentication);

0 commit comments

Comments
 (0)