       {:ok, version} ->
         version
       :error ->
-        version = 
-          run_system("git", ["--version"])
+        version =
+          :os.cmd('git --version')
+          |> IO.iodata_to_binary
           |> parse_version
 
         Mix.State.put(:git_version, version)

      {:ok, true} ->
        :ok
      :error ->
        if :os.find_executable('git') do
          Mix.State.put(:git_available, true)
        else
          Mix.raise "Error fetching/updating Git repository: the `git` "  <>


  defp do_checkout(opts) do
    ref = get_lock_rev(opts[:lock]) || get_opts_rev(opts)
    git!(["--git-dir=.git", "checkout", "--quiet", ref])

    if opts[:submodules] do
      git!(["--git-dir=.git" , "submodule", "update", "--init", "--recursive"])
    end

    get_lock(opts)
  end

  defp get_lock(opts) do
    rev_info = get_rev_info()
    {:git, opts[:git], rev_info[:rev], get_lock_opts(opts)}
  end

