# File lib/rhc/git_helper.rb, line 28
    def git_clone_repo(git_url, repo_dir)
      # quote the repo to avoid input injection risk
      repo_dir = (repo_dir ? " \"#{repo_dir}\"" : "")
      clone_cmd = "git clone #{git_url}#{repo_dir}"
      debug "Running #{clone_cmd}"

      err = nil
      if RHC::Helpers.windows?
        # windows does not support Open4 so redirect stderr to stdin
        # and print the whole output which is not as clean
        output = %x[#{clone_cmd} 2>&1]
        if $?.exitstatus != 0
          err = output + " - Check to make sure you have correctly installed git and it is added to your path."
        else
          say output
        end
      else
        paragraph do
          Open4.popen4(clone_cmd) do |pid, stdin, stdout, stderr|
            stdin.close
            say stdout.read
            err = stderr.read
          end
          say "done"
        end
      end

      raise RHC::GitException, "Error in git clone - #{err}" if $?.exitstatus != 0
    end