When checking the repo and remote state, use the API instead of parsing the output of raw commands