Determine git workdir properly

".git" can also be in a parent directory of the
current workdirectory. Figure out if it exists
at all, and then call git log.

Fixes LP Bug 1194804

Change-Id: Ic209724c64158b0e87b2e12a0fa8220ea2cb5155
Merge "Determine git workdir properly"