`if scm_name == 'git' and not os.path.isdir(git_dir):`? Probably the same in most cases, just a suggestion, i'm ok with current way.