Here is the problematic line in question.
function gradeUpdate() {workingDir=$(pwd); cd $GRADE_DIR; rm -Rf gradingScript/; git clone https://github.com/[redacted]/gradingScript/; cd $workingDir}
Of course, [redacted] in this case is the username of the repository owner. I can guarantee that $GRADE_DIR is a valid directory, and if I execute cd $GRADE_DIR in the Terminal, it works fine.
Also, if I enter all of the contents of the function (not the function itself) into the Terminal, then it works fine.