fix exit condition for recursive repo fetch