Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 14587b4

Browse files
Using string for the interface instead of NPath
1 parent 6491b31 commit 14587b4

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

src/GitHub.Api/Git/GitClient.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface IGitClient
1010
{
1111
Task<NPath> FindGitInstallation();
1212

13-
ITask<bool> ValidateGitInstall(NPath path);
13+
ITask<bool> ValidateGitInstall(string path);
1414

1515
ITask Init(IOutputProcessor<string> processor = null);
1616

@@ -153,9 +153,9 @@ private async Task<NPath> LookForSystemGit()
153153
return path;
154154
}
155155

156-
public ITask<bool> ValidateGitInstall(NPath path)
156+
public ITask<bool> ValidateGitInstall(string path)
157157
{
158-
if (!path.FileExists())
158+
if (!path.ToNPath().FileExists())
159159
{
160160
return new FuncTask<bool>(cancellationToken, () => false);
161161
}
@@ -164,29 +164,23 @@ public ITask<bool> ValidateGitInstall(NPath path)
164164
SoftwareVersion? gitLfsVersion = null;
165165

166166
var gitVersionTask = new GitVersionTask(cancellationToken);
167-
gitVersionTask.Configure(processManager, path.ToString(),
167+
gitVersionTask.Configure(processManager, path,
168168
gitVersionTask.ProcessArguments, environment.RepositoryPath);
169169

170170
var gitLfsVersionTask = new GitLfsVersionTask(cancellationToken);
171-
gitLfsVersionTask.Configure(processManager, path.ToString(),
171+
gitLfsVersionTask.Configure(processManager, path,
172172
gitLfsVersionTask.ProcessArguments, environment.RepositoryPath);
173173

174174
return gitVersionTask
175175
.Then((result, version) => { gitVersion = version; })
176176
.Then(gitLfsVersionTask)
177177
.Then((result, version) => {
178178
gitLfsVersion = version;
179-
}).Then(result => {
180-
if (result)
181-
{
182-
return gitVersion.HasValue &&
183-
gitVersion.Value >= new SoftwareVersion(2, 1, 0) &&
184-
gitLfsVersion.HasValue &&
185-
gitLfsVersion.Value >= new SoftwareVersion(2, 1, 0);
186-
}
187-
188-
return false;
189-
});
179+
}).Then(result => result &&
180+
gitVersion.HasValue &&
181+
gitVersion.Value >= new SoftwareVersion(2, 1, 0) &&
182+
gitLfsVersion.HasValue &&
183+
gitLfsVersion.Value >= new SoftwareVersion(2, 1, 0));
190184
}
191185

192186
public ITask Init(IOutputProcessor<string> processor = null)

0 commit comments

Comments
 (0)