Creates the repo folder locally, copies the static files and 
        folders available locally, initalizes the repo with git so it
        has the correct remote origin and is ready to sync.

        :arg staging: the full path to the directory to stage the unit tests in.

def init(self, archive):
        """Creates the repo folder locally, copies the static files and 
        folders available locally, initalizes the repo with git so it
        has the correct remote origin and is ready to sync.

        :arg staging: the full path to the directory to stage the unit tests in.
        """
        from os import makedirs, path, chdir, system, getcwd
        self.repodir = path.abspath(path.expanduser(self.repo.staging))

        if ("stage" in archive and path.isdir(archive["stage"]) and
            self.repodir != archive["stage"] and archive["stage"] is not None):
            #We have a previous attempt in a different staging directory to clean.
            from shutil import rmtree
            rmtree(archive["stage"])

        if not path.isdir(self.repodir):
            makedirs(self.repodir)
            
        #Copy across all the static files so that we don't have to download them
        #again and chew up the bandwidth. We don't have to copy files that already
        #exist in the local repo.
        self.repo.static.copy(self.repodir)
        cwd = getcwd()
        chdir(self.repodir)
        
        if not self._is_gitted():
            #Next we need to initialize the git repo, then add all the static files
            #and folders to be tracked so that when we pull from origin master they
            #can be merged into the repo without re-downloading them.
            system("git init")
            if not self.testmode:
                system("git remote add origin {}.git".format(self.repo.repo.html_url))

            for file in self.repo.static.files:
                #Here the 2:: removes the ./ specifying the path relative to the git
                #repository root. It is added by convention in the config files.
                system("git add {}".format(file["target"][2::]))
            for folder in self.repo.static.folders:
                system("git add {}".format(file["target"][2::]))

            #Now sync with the master branch so that we get everything else that isn't
            #static. Also, fetch the changes from the pull request head so that we
            #can merge them into a new branch for unit testing.
            if not self.testmode:
                system("git pull origin master")

        #Even though we have initialized the repo before, we still need to fetch the
        #pull request we are wanting to merge in.
        if not self.testmode:
            system("git fetch origin pull/{0}/head:testing_{0}".format(self.pull.number))
            system("git checkout testing_{}".format(pull.number))

        #The local repo now has the pull request's proposed changes and is ready
        #to be unit tested.
        chdir(cwd)