Fix issue where git repository was detected when it shouldn't (since somewhere up the directory tree a git repository exists)
Added functional tests for git repository exists method