Fix undeclared var commit_sha in checkout()

`commit_sha` wasn't declared anywhere in `repo.checkout()`. Change `commit_sha` to `ref` instead, which was a passed parameter anyway.