check if chdir worked before process the git pull
using repo slug instead of "name"
remove extra function