Use better method of determining if directory is managed by git