Moved calculation of head input for incremental builds

Moved it inside the target so that it's refreshed after getting the git root path. 
Previously we had it as an ItemGroup at the root level and that was too early.