mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 11:46:38 +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
|
||||
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
|
||||
|
|
|
@ -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 ).
|
||||
|
||||
RAISE EXCEPTION lx_exception.
|
||||
|
||||
ENDTRY.
|
||||
|
||||
mo_branches = lcl_git_transport=>branches( get_url( ) ).
|
||||
actualize_head_branch( ).
|
||||
|
@ -295,6 +307,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
|
||||
|
||||
*----------------------------------------------------------------------*
|
||||
|
|
Loading…
Reference in New Issue
Block a user