Fix detection of .git

Change-Id: If6d94173fef381a6bed2a1837eb409e99157a7bd
Reviewed-on: http://review.couchbase.org/36493
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>