This function figures out if a set of paths was last modified upstream or
if there are some local modifications made to them.
It can be used to figure out if we should download artifacts from CI or rather
build them locally.
Returns the most recent (ordered chronologically) commit found in the local history that
should exist upstream. We identify upstream commits by the e-mail of the commit
author.
Returns the files that have been modified in the current branch compared to the master branch.
This includes committed changes, uncommitted changes, and changes that are not even staged.
diff-index can return outdated information, because it does not update the git index.
This function uses update-index to update the index first, and then provides func with a
command prepared to run git diff-index.