GitHub broke my scp

I set up git on my FreeBSD box so that I can commit my code to GitHub. Today I tried to scp some stuff over and I was met with this rather unhelpful message:

[email protected] ~/Projects/code
$ scp -r [email protected]:~/code/agnostic .
Password:
ps: Process environment requires procfs(5)
Initializing new SSH agent...

[email protected] ~/Projects/code
$

I fixed the procfs problem by adding the following to my /etc/fstab:

proc                    /proc           procfs  rw              0       0
linproc                 /compat/linux/proc      linprocfs       rw      0       0

and then running:

[email protected] ~
$ sudo mount /compat/linux/proc

[email protected] ~
$ sudo mount /proc  

So I try to scp again and I get:

[email protected] ~/Projects/code
$ scp -r [email protected]:~/code/agnostic .
Password:
Initializing new SSH agent...

[email protected] ~/Projects/code
$

WTF? Then I remembered making some changes to my .bashrc to be able to commit to github:

function start_agent {
  echo "Initializing new SSH agent..."
  /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
  echo succeeded
  chmod 600 "${SSH_ENV}"
  . "${SSH_ENV}" > /dev/null
  /usr/bin/ssh-add;
}

# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
  . "${SSH_ENV}" > /dev/null
  #ps ${SSH_AGENT_PID} doesn't work under cywgin
  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
    start_agent;
  }
else
  start_agent;
fi

I pulled all that out of my .bashrc and made a separate shell script for it. After I did that, scp started working again. I had no idea that calling scp would actually run .bashrc