From 34b9c9a1a1ba237ae7d7fd923e42b70d404db158 Mon Sep 17 00:00:00 2001 From: bigld Date: Sun, 11 Jun 2017 22:18:38 +0200 Subject: [PATCH 1/3] delete online repo after error if new --- src/zabapgit_repo.prog.abap | 3 +++ src/zabapgit_repo_impl.prog.abap | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/zabapgit_repo.prog.abap b/src/zabapgit_repo.prog.abap index 0f07cdfa4..131144ca6 100644 --- a/src/zabapgit_repo.prog.abap +++ b/src/zabapgit_repo.prog.abap @@ -147,6 +147,9 @@ CLASS lcl_repo_online DEFINITION INHERITING FROM lcl_repo FINAL. initialize RAISING lcx_exception, actualize_head_branch + RAISING lcx_exception, + delete_initial_online_repo + importing iv_commit type flag RAISING lcx_exception. ENDCLASS. "lcl_repo_online DEFINITION diff --git a/src/zabapgit_repo_impl.prog.abap b/src/zabapgit_repo_impl.prog.abap index ef402633c..2a9859a18 100644 --- a/src/zabapgit_repo_impl.prog.abap +++ b/src/zabapgit_repo_impl.prog.abap @@ -295,6 +295,20 @@ CLASS lcl_repo_online IMPLEMENTATION. ENDMETHOD. " rebuild_local_checksums. + METHOD delete_initial_online_repo. + + IF me->is_offline( ) = abap_false AND me->get_sha1_local( ) IS INITIAL. + + lcl_app=>repo_srv( )->delete( me ). + + IF iv_commit = abap_true. + COMMIT WORK. + ENDIF. + + ENDIF. + + ENDMETHOD. " delete_initial_online_repo + ENDCLASS. "lcl_repo_online IMPLEMENTATION *----------------------------------------------------------------------* From 88a4158c89eb1d8e7affe2cf79152be676355004 Mon Sep 17 00:00:00 2001 From: bigld Date: Sun, 11 Jun 2017 22:42:54 +0200 Subject: [PATCH 2/3] delete online repo after error if new --- src/zabapgit_repo_impl.prog.abap | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/zabapgit_repo_impl.prog.abap b/src/zabapgit_repo_impl.prog.abap index 2a9859a18..14e14190d 100644 --- a/src/zabapgit_repo_impl.prog.abap +++ b/src/zabapgit_repo_impl.prog.abap @@ -72,6 +72,8 @@ CLASS lcl_repo_online IMPLEMENTATION. METHOD refresh. + DATA: lx_exception TYPE REF TO lcx_exception. + super->refresh( iv_drop_cache ). reset_status( ). @@ -80,10 +82,20 @@ CLASS lcl_repo_online IMPLEMENTATION. iv_total = 1 iv_text = 'Remote files' ) ##NO_TEXT. - lcl_git_porcelain=>pull( EXPORTING io_repo = me - IMPORTING et_files = mt_remote - et_objects = mt_objects - ev_branch = mv_branch ). + TRY. + + lcl_git_porcelain=>pull( EXPORTING io_repo = me + IMPORTING et_files = mt_remote + et_objects = mt_objects + ev_branch = mv_branch ). + + CATCH lcx_exception INTO lx_exception. + + delete_initial_online_repo( abap_true ). + + lcx_exception=>raise( iv_text = lx_exception->mv_text ). + + ENDTRY. mo_branches = lcl_git_transport=>branches( get_url( ) ). actualize_head_branch( ). @@ -295,7 +307,7 @@ CLASS lcl_repo_online IMPLEMENTATION. ENDMETHOD. " rebuild_local_checksums. - METHOD delete_initial_online_repo. + METHOD delete_initial_online_repo. IF me->is_offline( ) = abap_false AND me->get_sha1_local( ) IS INITIAL. From 9f675bab5e3d397daf8d7db185bd3df53b00e2c7 Mon Sep 17 00:00:00 2001 From: bigld Date: Tue, 13 Jun 2017 23:24:33 +0200 Subject: [PATCH 3/3] raise exception direct --- src/zabapgit_repo_impl.prog.abap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zabapgit_repo_impl.prog.abap b/src/zabapgit_repo_impl.prog.abap index 14e14190d..eaedd802a 100644 --- a/src/zabapgit_repo_impl.prog.abap +++ b/src/zabapgit_repo_impl.prog.abap @@ -93,7 +93,7 @@ CLASS lcl_repo_online IMPLEMENTATION. delete_initial_online_repo( abap_true ). - lcx_exception=>raise( iv_text = lx_exception->mv_text ). + RAISE EXCEPTION lx_exception. ENDTRY.