From 193c54522887658b7a3c01af27767c3cf2148f61 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Tue, 5 Jan 2021 14:16:22 +0100 Subject: [PATCH] (GH-738) added resolving of "git.exe" to all cases of resolving "git" to make them work on windows. --- Cake.Recipe/Content/github-actions.cake | 4 ++++ Cake.Recipe/Content/localbuild.cake | 6 +++++- Cake.Recipe/Content/parameters.cake | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Cake.Recipe/Content/github-actions.cake b/Cake.Recipe/Content/github-actions.cake index 3157d2f1..5a006566 100644 --- a/Cake.Recipe/Content/github-actions.cake +++ b/Cake.Recipe/Content/github-actions.cake @@ -40,6 +40,10 @@ public class GitHubActionRepositoryInfo : IRepositoryInfo else if (tempName.StartsWith(tagPrefix)) { var gitTool = context.Tools.Resolve("git"); + if (gitTool == null) + { + gitTool = context.Tools.Resolve("git.exe"); + } if (gitTool != null) { diff --git a/Cake.Recipe/Content/localbuild.cake b/Cake.Recipe/Content/localbuild.cake index a4067de8..58951a66 100644 --- a/Cake.Recipe/Content/localbuild.cake +++ b/Cake.Recipe/Content/localbuild.cake @@ -63,7 +63,11 @@ public class LocalBuildRepositoryInfo : IRepositoryInfo var rootPath = context.GitFindRootFromPath(context.MakeAbsolute(context.Environment.WorkingDirectory)); var gitTool = context.Tools.Resolve("git"); - + if (gitTool == null) + { + gitTool = context.Tools.Resolve("git.exe"); + } + if (gitTool == null) { context.Warning("Unable to find git, setting default values for repository properties..."); diff --git a/Cake.Recipe/Content/parameters.cake b/Cake.Recipe/Content/parameters.cake index f4b2caa2..06d5e0b3 100644 --- a/Cake.Recipe/Content/parameters.cake +++ b/Cake.Recipe/Content/parameters.cake @@ -555,7 +555,11 @@ public static class BuildParameters { BranchType = BranchType.Unknown; var gitTool = context.Tools.Resolve("git"); - + if (gitTool == null) + { + gitTool = context.Tools.Resolve("git.exe"); + } + if (gitTool != null) { IEnumerable redirectedStandardOutput;