diff --git a/eng/common/scripts/Delete-RemoteBranches.ps1 b/eng/common/scripts/Delete-RemoteBranches.ps1 index 6b2e4347224c..f9e73e75405d 100644 --- a/eng/common/scripts/Delete-RemoteBranches.ps1 +++ b/eng/common/scripts/Delete-RemoteBranches.ps1 @@ -33,8 +33,8 @@ foreach ($res in $responses) continue } $branch = $res.ref + $branchName = $branch.Replace("refs/heads/","") try { - $branchName = $branch.Replace("refs/heads/","") $head = "${RepoId}:${branchName}" LogDebug "Operating on branch [ $branchName ]" $pullRequests = Get-GitHubPullRequests -RepoId $RepoId -State "all" -Head $head -AuthToken $AuthToken @@ -62,11 +62,11 @@ 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." + LogDebug "No last commit date or the branch $branch last commit date [ $commitDate ] is newer than the date $LastCommitOlderThan. Skipping." continue } - LogDebug "Branch [ $branch ] in repo [ $RepoId ] has a last commit date $commitDate that is older than $LastCommitOlderThan. " + LogDebug "Branch [ $branchName ] in repo [ $RepoId ] has a last commit date [ $commitDate ] that is older than $LastCommitOlderThan. " } catch { LogError "Get-GithubReferenceCommitDate failed with exception:`n$_" @@ -75,7 +75,7 @@ foreach ($res in $responses) } try { Remove-GitHubSourceReferences -RepoId $RepoId -Ref $branch -AuthToken $AuthToken - LogDebug "The branch $branch in $RepoId has been deleted." + LogDebug "The branch [ $branchName ] in [ $RepoId ] has been deleted." } catch { LogError "Remove-GitHubSourceReferences failed with exception:`n$_"