Okay so the above answer by @Luk En helps . I wanted to add that I was facing the same issue while trying to use the SFDX Git Delta plugin inside AWS Code Build , and Code Pipeline . I used the same fix , to CLONE FULL DEPTH in the source stage at both pipeline and build job level .
(P.S. The option at Build Job level is a bit difficult to find. Its there under Source > Additional Options > Depth . Set it to full!!)
It worked ! :)