#!/bin/zsh
#function t_setup_real {
  0=${(%):-%x}

  # Setup using standard test infrastructure
  t_setup

  # Override for real cloning (no fixture gitconfig, no test config)
  typeset -g T_PRJDIR="${0:A:h:h:h}"
  typeset -g T_TESTDATA=$T_PRJDIR/tests/testdata/real
  unset ANTIDOTE_CONFIG

  # replace fixture gitconfig so we clone from real GitHub; keep
  # background maintenance off since detached git gc processes race
  # t_teardown's rm -rf of the tempdir
  printf '[gc]\n\tauto = 0\n[maintenance]\n\tauto = false\n' > "$HOME/.gitconfig"

  # unsetting ANTIDOTE_CONFIG drops the test config, so set the deepen
  # hook here: a disowned fetch outlives its clone and races the same
  # rm -rf. Real repos have real history, so this is the slow one.
  zstyle ':antidote:test:git' background-deepen 'no'

  # replace test versions of bundle files with real versions
  local file
  for file in .zsh_plugins.txt .zsh_plugins.zsh; do
    [[ -f $T_TESTDATA/$file ]] && command cp -f -- "$T_TESTDATA/$file" "$ZDOTDIR/$file"
  done

  # clean out antidote home
  [[ -d $ANTIDOTE_HOME ]] && command rm -rf -- "$ANTIDOTE_HOME"
  mkdir -p "$ANTIDOTE_HOME"
#}
