fix $ret handling in sync_repo