def detect_git_repository(repodir='.'):
    for fname in os.listdir(repodir):
        if fname == '.git':
            fullname = os.path.join(repodir, fname)
            st = os.stat(fullname)
            if stat.S_ISDIR(st.st_mode):
                return True
    return False
Detect if ``repodir`` is a git repository.
dataset/ETHPy150Open ravello/testmill/lib/testmill/versioncontrol.py/detect_git_repository