From 66664b19f2bbf016e3888393823d3147b38d4d4b Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Thu, 28 Apr 2022 11:14:54 -0700 Subject: [PATCH] Update Delete-RemoteBranches.ps1 --- eng/common/scripts/Delete-RemoteBranches.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/Delete-RemoteBranches.ps1 b/eng/common/scripts/Delete-RemoteBranches.ps1 index f9e73e75405d..4ee3f1b05dcd 100644 --- a/eng/common/scripts/Delete-RemoteBranches.ps1 +++ b/eng/common/scripts/Delete-RemoteBranches.ps1 @@ -61,8 +61,13 @@ foreach ($res in $responses) } try { $commitDate = Get-GithubReferenceCommitDate -commitUrl $res.object.url -AuthToken $AuthToken - if (!$commitDate -or ($commitDate -gt $LastCommitOlderThan)) { - LogDebug "No last commit date or the branch $branch last commit date [ $commitDate ] is newer than the date $LastCommitOlderThan. Skipping." + if (!$commitDate) + { + LogDebug "No last commit date found. Skipping." + continue + } + if ($commitDate -gt $LastCommitOlderThan) { + LogDebug "The branch $branch last commit date [ $commitDate ] is newer than the date $LastCommitOlderThan. Skipping." continue }