-
-
Notifications
You must be signed in to change notification settings - Fork 571
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Hi everyone. I want all changes of all repositories to be pushed every night to a certain branch called "nightly". To achieve this, I created a custom program that is running before the ZABAPGIT job.
However, since I updated abapGit to the latest version two days ago, the ZABAPGIT background job deletes objects on Git even though they still exist locally. I want to check if the way I am switching branches could be the cause of the issue.
Here's my logic in its most simple form. It's more encapsulated and has additional logic, but I've reduced it to only the relevant abapGit logic for the purpose of this issue.
Can you please tell me if this is the right way to switch branches of repositories? Could this be causing issues?
TRY.
zcl_abapgit_background=>enqueue( ).
DATA(lt_repositories) = zcl_abapgit_repo_srv=>get_instance( )->list( ).
LOOP AT lt_repositories INTO DATA(lo_repository).
IF lo_repository->is_offline( ).
CONTINUE.
ENDIF.
DATA(lo_online_repository) = CAST zcl_abapgit_repo_online( lo_repository ).
IF lo_online_repository->get_selected_branch( ) = 'refs/heads/nightly'.
lo_online_repository->select_branch( 'refs/heads/nightly' ).
ENDIF.
COMMIT WORK AND WAIT.
ENDLOOP.
zcl_abapgit_background=>dequeue( ).
CATCH zcx_abapgit_exception INTO DATA(lo_exception).
MESSAGE lo_exception TYPE 'A'.
ENDTRY.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested