mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Merge pull request #787 from bigld/master
#752 delete online repo record if error during cloning
This commit is contained in:
commit
ef2cf18015
|
@ -147,6 +147,9 @@ CLASS lcl_repo_online DEFINITION INHERITING FROM lcl_repo FINAL.
|
||||||
initialize
|
initialize
|
||||||
RAISING lcx_exception,
|
RAISING lcx_exception,
|
||||||
actualize_head_branch
|
actualize_head_branch
|
||||||
|
RAISING lcx_exception,
|
||||||
|
delete_initial_online_repo
|
||||||
|
importing iv_commit type flag
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
ENDCLASS. "lcl_repo_online DEFINITION
|
ENDCLASS. "lcl_repo_online DEFINITION
|
||||||
|
|
|
@ -72,6 +72,8 @@ CLASS lcl_repo_online IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD refresh.
|
METHOD refresh.
|
||||||
|
|
||||||
|
DATA: lx_exception TYPE REF TO lcx_exception.
|
||||||
|
|
||||||
super->refresh( iv_drop_cache ).
|
super->refresh( iv_drop_cache ).
|
||||||
reset_status( ).
|
reset_status( ).
|
||||||
|
|
||||||
|
@ -80,10 +82,20 @@ CLASS lcl_repo_online IMPLEMENTATION.
|
||||||
iv_total = 1
|
iv_total = 1
|
||||||
iv_text = 'Remote files' ) ##NO_TEXT.
|
iv_text = 'Remote files' ) ##NO_TEXT.
|
||||||
|
|
||||||
lcl_git_porcelain=>pull( EXPORTING io_repo = me
|
TRY.
|
||||||
IMPORTING et_files = mt_remote
|
|
||||||
et_objects = mt_objects
|
lcl_git_porcelain=>pull( EXPORTING io_repo = me
|
||||||
ev_branch = mv_branch ).
|
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 ).
|
||||||
|
|
||||||
|
RAISE EXCEPTION lx_exception.
|
||||||
|
|
||||||
|
ENDTRY.
|
||||||
|
|
||||||
mo_branches = lcl_git_transport=>branches( get_url( ) ).
|
mo_branches = lcl_git_transport=>branches( get_url( ) ).
|
||||||
actualize_head_branch( ).
|
actualize_head_branch( ).
|
||||||
|
@ -295,6 +307,20 @@ CLASS lcl_repo_online IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD. " rebuild_local_checksums.
|
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
|
ENDCLASS. "lcl_repo_online IMPLEMENTATION
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
*----------------------------------------------------------------------*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user