You need a Python dependency.

Your project installs a package from a Git URL, pinned to commit C.

YOU / BEFORE INSTALL01 / 05
Git dependencySIMULATED
SOURCE IN YOUR DEPENDENCY LIST
https://mirror.example.test/package.git
PINNED REVISION
C
DELIVERY IN THIS EXAMPLE
Attacker-controlled object mirror · both trees included
The attacker controls this source.

Assume this mirror serves the malformed commit and both trees. A host that validates objects or prunes the second tree can stop delivery.