Move checkout out branch to external script's responsibility.