Added check_err helper function for repo_commit