Skip to content

Commit 2fac84d

Browse files
committed
Ensure orphaned commits are available for diffing by fetching the specified FromSha
1 parent f31a5e4 commit 2fac84d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Get-Changed-Components.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ if (-not $ToSha) {
3030
$ToSha = $(git rev-parse HEAD)
3131
}
3232

33+
# Ensure that orphaned commits are available for diffing (e.g. when force-pushed).
34+
git fetch origin $FromSha
3335
git fetch origin main
3436

3537
$changedComponentFiles = Invoke-Expression "git diff --name-only $($FromSha)...$($ToSha) -- components/" -ErrorAction Stop

0 commit comments

Comments
 (0)