From 40d1f9c4ce7a564ddbeeea69c3376d8ccd626c21 Mon Sep 17 00:00:00 2001 From: sima-zhu Date: Wed, 16 Mar 2022 13:43:46 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools repository for Tools PR 2861 --- .../scripts/get-diff-changes-from-PR.ps1 | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 eng/common/scripts/get-diff-changes-from-PR.ps1 diff --git a/eng/common/scripts/get-diff-changes-from-PR.ps1 b/eng/common/scripts/get-diff-changes-from-PR.ps1 deleted file mode 100644 index 14f2c57014ebc..0000000000000 --- a/eng/common/scripts/get-diff-changes-from-PR.ps1 +++ /dev/null @@ -1,32 +0,0 @@ - -function Get-PullRequest-Diff-Changes { - param ( - [string]$SourceCommittish= "${env:BUILD_SOURCEVERSION}", - [string]$TargetCommittish = ("origin/${env:SYSTEM_PULLREQUEST_TARGETBRANCH}" -replace "refs/heads/"), - [string]$DiffPath, - [string]$DiffFilterType = "d" - ) - # If ${env:SYSTEM_PULLREQUEST_TARGETBRANCH} is empty, then return empty. - if ($TargetCommittish -eq "origin/") { - Write-Host "There is no target branch passed in. " - return "" - } - - # Git PR diff: https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-comparing-branches-in-pull-requests#three-dot-and-two-dot-git-diff-comparisons - $command = "git -c core.quotepath=off -c i18n.logoutputencoding=utf-8 diff `"$TargetCommittish...$SourceCommittish`" --name-only --diff-filter=$DiffFilterType" - if ($DiffPath) { - $command = $command + " -- `'$DiffPath`'" - } - Write-Host $command - $changedFiles = Invoke-Expression -Command $command - if(!$changedFiles) { - Write-Host "No changed files in git diff between $TargetCommittish and $SourceCommittish" - } - else { - Write-Host "Here are the diff files:" - foreach ($file in $changedFiles) { - Write-Host " $file" - } - } - return $changedFiles -}