From 3ab0a6f7dc49f647319f457cce1b0f14799da948 Mon Sep 17 00:00:00 2001 From: Kosta Dunn Date: Wed, 9 Sep 2020 12:18:44 -0700 Subject: [PATCH] Update git clone to not fail the artifact --- Artifacts/windows-clone-git-repo/GitEnlister.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Artifacts/windows-clone-git-repo/GitEnlister.ps1 b/Artifacts/windows-clone-git-repo/GitEnlister.ps1 index 8b979a78d..ced98250c 100644 --- a/Artifacts/windows-clone-git-repo/GitEnlister.ps1 +++ b/Artifacts/windows-clone-git-repo/GitEnlister.ps1 @@ -418,10 +418,10 @@ function CloneGitRepo WriteLog $($gitExeLocation + " " + $args) # Run the git clone operation - $p = Start-Process -FilePath $gitExeLocation -ArgumentList $args -RedirectStandardOutput $stdOutLogfile -RedirectStandardError $stdErrLogfile -PassThru -Wait + & cmd /c "git $args 2>&1" # Was the clone operation successful? - if ($p.ExitCode -ne 0) + if ($LASTEXITCODE -ne 0) { $errMsg = $("Error! Git clone failed with exit code " + $p.ExitCode + ". Please see the log file: " + $stdErrLogfile) WriteLog $errMsg