Fix detection of .git

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