Avoid traversing git history for added files
"Compare with HEAD" for a file did search the whole git history even
for staged added files, which could be very expensive and on some
repositories can take very long indeed. Avoid this by checking first
whether the file exists at all in the HEAD commit, and only then try
to find the last commit that touched it. Otherwise return an empty
element.
Bug: 544404
Change-Id: Idc9e9e3ba80faeb94b96391c32f58b5365164b8a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>