Skip to content

Commit

Permalink
Update Delete-RemoteBranches.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
sima-zhu authored and azure-sdk committed Apr 28, 2022
1 parent c766278 commit 0c6cc17
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions eng/common/scripts/Delete-RemoteBranches.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 0c6cc17

Please sign in to comment.