def getRepositoryCommand(directory):
 try:
  GitCommand.ensureIsWorkingDirectory(directory)
  return GitCommand
 except (NotWorkingDirectory, OSError):
  pass
 raise NotWorkingDirectory(('No supported VCS can be found in %s' % (directory.path,)))

def getRepositoryCommand ( directory ) : try : GitCommand . ensureIsWorkingDirectory ( directory ) return GitCommand except ( NotWorkingDirectory , OSError ) : pass raise NotWorkingDirectory ( ( 'No supported VCS can be found in %s' % ( directory . path , ) ) )
detect the vcs used in the specified directory and return a l{gitcommand} if the directory is a git repository .