File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -229,15 +229,21 @@ def find(self, run_args):
229229 lst .append (i )
230230 elif repo_name == i .meta ['alias' ]:
231231 lst .append (i )
232- elif utils .is_uid (repo ) and not any (i .meta ['uid' ] == repo_uid for i in self .repos ):
232+
233+
234+ # After loop, check if any match was found
235+ if not lst and not matched_repo_path :
236+ # Determine error message based on input
237+ if utils .is_uid (repo ):
233238 return {"return" : 1 , "error" : f"No repository with UID: '{ repo_uid } ' was found" }
234- elif "," in repo and not matched_repo_path and not any ( i . meta [ 'uid' ] == repo_uid for i in self . repos ) and not any ( i . meta [ 'alias' ] == repo_name for i in self . repos ) :
239+ elif "," in repo and not matched_repo_path :
235240 return {"return" : 1 , "error" : f"No repository with alias: '{ repo_name } ' and UID: '{ repo_uid } ' was found" }
236- elif not matched_repo_path and not any ( i . meta [ 'alias' ] == repo_name for i in self . repos ) and not any ( i . meta [ 'uid' ] == repo_uid for i in self . repos ) :
241+ else :
237242 return {"return" : 1 , "error" : f"No repository with alias: '{ repo_name } ' was found" }
243+
238244
239245 # Append the matched repo path
240- if (len (lst )== 0 ):
246+ if (len (lst )== 0 and matched_repo_path ):
241247 lst .append (matched_repo_path )
242248
243249 return {'return' : 0 , 'list' : lst }
You can’t perform that action at this time.
0 commit comments