Skip to content

Commit 403242e

Browse files
azure-sdkscbedd
andauthored
Sync eng/common directory with azure-sdk-tools for PR 9823 (Azure#2146)
* handle defaults for changedfiles, deletedfiles, and changedServices --------- Co-authored-by: Scott Beddall <[email protected]>
1 parent 1e33e82 commit 403242e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

eng/common/scripts/Generate-PR-Diff.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,23 @@ $deletedFiles = Get-ChangedFiles -DiffPath $TargetPath -DiffFilterType "D"
5353
if ($changedFiles) {
5454
$changedServices = Get-ChangedServices -ChangedFiles $changedFiles
5555
}
56+
else {
57+
# ensure we default this to an empty array if not set
58+
$changedFiles = @()
59+
}
5660

5761
# ExcludePaths is an object array with the default of [] which evaluates to null.
5862
# If the value is null, set it to empty list to ensure that the empty list is
5963
# stored in the json
6064
if (-not $ExcludePaths) {
6165
$ExcludePaths = @()
6266
}
67+
if (-not $deletedFiles) {
68+
$deletedFiles = @()
69+
}
70+
if (-not $changedServices) {
71+
$changedServices = @()
72+
}
6373
$result = [PSCustomObject]@{
6474
"ChangedFiles" = $changedFiles
6575
"ChangedServices" = $changedServices

0 commit comments

Comments
 (0)