Don't quite get whats the issue.
What happens here is that the repo_checkout method will return a string which will be launched as a background job, which PID will be added into PIDS array.