code: public static GitService cloneSiteRepo(Status status) throws Exception {
      File tmpDir = File.createTempFile("site", "git");
      GitService git = null;
      if(tmpDir.delete()) {
        try {
          git = GitService.cloneRepo(status.getRepo(), tmpDir.getAbsolutePath());
          if(status.getBranch() != null && !git.getBranchName().equals(status.getBranch())) {
            git.switchBranch(status.getBranch());
          }
          if(status.getRevision() != null && !git.getCurrentRevision().equals(status.getRevision())) {
            git.resetToRev(status.getRevision());
          }
        } catch(Exception e) {
          System.err.println("Failed to clone repo "+status.getRepo()+" branch "+status.getBranch()+ "["+tmpDir+"]");
          e.printStackTrace();
          if(git != null) {
            git.close();
            git = null;
          }
        }
      }
      return git;
    }
docs: Clones a repository locally from a status response from a Cadmium site.
  @param status The status response to clone locally.
  @return The {@link GitService} object that points to the newly cloned remote repo.
  @throws Exception