From 3b95ef0b9558e977877f47eaa7eaae6f6ec2062d Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 25 Feb 2019 12:55:54 -0800 Subject: [PATCH] Ignore error output from git diff in code check (#7923) --- eng/scripts/CodeCheck.ps1 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/eng/scripts/CodeCheck.ps1 b/eng/scripts/CodeCheck.ps1 index 4680faf57a..e52d9fc26c 100644 --- a/eng/scripts/CodeCheck.ps1 +++ b/eng/scripts/CodeCheck.ps1 @@ -133,14 +133,10 @@ try { Write-Host "Run git diff to check for pending changes" # Redirect stderr to stdout because PowerShell does not consistently handle output to stderr - $changedFiles = & cmd /c 'git --no-pager diff --ignore-space-at-eol --name-only 2>&1' + $changedFiles = & cmd /c 'git --no-pager diff --ignore-space-at-eol --name-only 2>nul' if ($changedFiles) { foreach ($file in $changedFiles) { - if (($file -like 'warning:*') -or ($file -like 'The file will have its original line endings*')) { - # git might emit warnings to stderr about CRLF vs LR, which can vary from machine to machine based on git's configuration - continue - } $filePath = Resolve-Path "${repoRoot}/${file}" LogError "Generated code is not up to date in $file." -filepath $filePath & git --no-pager diff --ignore-space-at-eol $filePath