From 6d0861a7bd29444286e7c8c509b7fb59fa565876 Mon Sep 17 00:00:00 2001 From: Marc Bernard <59966492+mbtools@users.noreply.github.com> Date: Wed, 27 May 2020 15:06:52 +0200 Subject: [PATCH] Fix "repo not found" error (#3416) Fix for https://github.com/larshp/abapGit/issues/2938 Co-authored-by: Lars Hvam --- src/zcl_abapgit_repo_srv.clas.abap | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/zcl_abapgit_repo_srv.clas.abap b/src/zcl_abapgit_repo_srv.clas.abap index ff6d876d3..28f66cb61 100644 --- a/src/zcl_abapgit_repo_srv.clas.abap +++ b/src/zcl_abapgit_repo_srv.clas.abap @@ -242,12 +242,18 @@ CLASS zcl_abapgit_repo_srv IMPLEMENTATION. refresh( ). ENDIF. - LOOP AT mt_list ASSIGNING . - IF ->get_key( ) = iv_key. - ro_repo = . - RETURN. + DO 2 TIMES. + " Repo might have been created in another session. Try again after refresh + IF sy-index = 2. + refresh( ). ENDIF. - ENDLOOP. + LOOP AT mt_list ASSIGNING . + IF ->get_key( ) = iv_key. + ro_repo = . + RETURN. + ENDIF. + ENDLOOP. + ENDDO. zcx_abapgit_exception=>raise( 'repo not found, get' ).