code: def _is_gitted(self):
          
          from os import waitpid
          from subprocess import Popen, PIPE
      
          premote = Popen("cd {}; git remote -v".format(self.repodir),
                          shell=True, executable="/bin/bash", stdout=PIPE, stderr=PIPE)
          waitpid(premote.pid, 0)
          remote = premote.stdout.readlines()
          remerr = premote.stderr.readlines()
  
          pbranch = Popen("cd {}; git branch".format(self.repodir),
                          shell=True, executable="/bin/bash", stdout=PIPE, stderr=PIPE)
          waitpid(pbranch.pid, 0)
          branch = pbranch.stdout.readlines()
          braerr = pbranch.stderr.readlines()
  
          if len(remote) > 0 and len(remerr) > 0 and len(branch) > 0:
              return ((".git" in remote[0] and "fatal" not in remerr[0])
                      and any(["testing" in b for b in branch]))
          elif self.testmode and len(remote) == 0 and len(branch) == 0 and len(remerr) == 0:
              return True
          else:
              return False
docs: Returns true if the current repodir has been initialized in git *and*
          had a remote origin added *and* has a 'testing' branch.