added git checkout before git pull.
Fixing bug where an email would try to be sent, even if it shouldn't.