anchor.diff:    ENDMETHOD.
   
   
  -  METHOD deserialize.
  +  METHOD find_remote_dot_abapgit.
  +
  +    FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
  +
  +    get_files_remote( ).
  +
  +    READ TABLE mt_remote ASSIGNING <ls_remote>
  +      WITH KEY file_path
  +      COMPONENTS path     = zif_abapgit_definitions=>c_root_dir
  +                 filename = zif_abapgit_definitions=>c_dot_abapgit.
  +    IF sy-subrc = 0.
  +      ro_dot = zcl_abapgit_dot_abapgit=>deserialize( <ls_remote>-data ).
  +      set_dot_abapgit( ro_dot ).
  +      COMMIT WORK AND WAIT. " to release lock
  +    ENDIF.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD find_remote_dot_apack.
  +
  +    FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
  +
  +    get_files_remote( ).
  +
  +    READ TABLE mt_remote ASSIGNING <ls_remote>
  +      WITH KEY file_path
  +      COMPONENTS path     = zif_abapgit_definitions=>c_root_dir
  +                 filename = zif_abapgit_apack_definitions=>c_dot_apack_manifest.
  +    IF sy-subrc = 0.
  +      ro_dot = zcl_abapgit_apack_reader=>deserialize( iv_package_name = ms_data-package
  +                                                      iv_xstr         = <ls_remote>-data ).
  +      set_dot_apack( ro_dot ).
  +    ENDIF.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD get_data_config.
  +
  +    FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
  +
  +    IF mi_data_config IS BOUND.
  +      ri_config = mi_data_config.
  +      RETURN.
  +    ENDIF.
  +
  +    CREATE OBJECT ri_config TYPE zcl_abapgit_data_config.
  +    mi_data_config = ri_config.
  +
  +    " Assume remote data has been loaded already
  +    READ TABLE mt_remote ASSIGNING <ls_remote>
  +      WITH KEY file_path
  +      COMPONENTS path = zif_abapgit_data_config=>c_default_path.
  +    IF sy-subrc = 0.
  +      ri_config->from_json( mt_remote ).
  +    ENDIF.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD get_dot_apack.
  +    IF mo_apack_reader IS NOT BOUND.
  +      mo_apack_reader = zcl_abapgit_apack_reader=>create_instance( ms_data-package ).
  +    ENDIF.
  +
  +    ro_dot_apack = mo_apack_reader.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD get_log.
  +    ri_log = mi_log.
  +  ENDMETHOD.
  +
  +
  +  METHOD get_unsupported_objects_local.
  +
  +    DATA: lt_tadir           TYPE zif_abapgit_definitions=>ty_tadir_tt,
  +          lt_supported_types TYPE zcl_abapgit_objects=>ty_types_tt.
  +
  +    FIELD-SYMBOLS: <ls_tadir>  LIKE LINE OF lt_tadir,
  +                   <ls_object> LIKE LINE OF rt_objects.
  +
  +    lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
  +                      iv_package            = ms_data-package
  +                      iv_ignore_subpackages = ms_data-local_settings-ignore_subpackages
  +                      iv_only_local_objects = ms_data-local_settings-only_local_objects
  +                      io_dot                = get_dot_abapgit( ) ).
  +
  +    lt_supported_types = zcl_abapgit_objects=>supported_list( ).
  +    LOOP AT lt_tadir ASSIGNING <ls_tadir>.
  +      READ TABLE lt_supported_types WITH KEY table_line = <ls_tadir>-object TRANSPORTING NO FIELDS.
  +      IF sy-subrc <> 0.
  +        APPEND INITIAL LINE TO rt_objects ASSIGNING <ls_object>.
  +        MOVE-CORRESPONDING <ls_tadir> TO <ls_object>.
  +        <ls_object>-obj_type = <ls_tadir>-object.
  +      ENDIF.
  +    ENDLOOP.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD notify_listener.
  +
  +    DATA ls_meta_slug TYPE zif_abapgit_persistence=>ty_repo_xml.
  +
  +    IF mi_listener IS BOUND.
  +      MOVE-CORRESPONDING ms_data TO ls_meta_slug.
  +      mi_listener->on_meta_change(
  +        iv_key         = ms_data-key
  +        is_meta        = ls_meta_slug
  +        is_change_mask = is_change_mask ).
  +    ENDIF.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD refresh_local_object.
  +
  +    DATA:
  +      ls_tadir           TYPE zif_abapgit_definitions=>ty_tadir,
  +      lt_tadir           TYPE zif_abapgit_definitions=>ty_tadir_tt,
  +      lt_new_local_files TYPE zif_abapgit_definitions=>ty_files_item_tt,
  +      lo_serialize       TYPE REF TO zcl_abapgit_serialize.
  +
  +    lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
  +                   iv_package = ms_data-package
  +                   io_dot     = get_dot_abapgit( ) ).
  +
  +    DELETE mt_local WHERE item-obj_type = iv_obj_type
  +                    AND   item-obj_name = iv_obj_name.
  +
  +    READ TABLE lt_tadir INTO ls_tadir
  +                        WITH KEY object   = iv_obj_type
  +                                 obj_name = iv_obj_name.
  +    IF sy-subrc <> 0 OR ls_tadir-delflag = abap_true.
  +      " object doesn't exist anymore, nothing todo here
  +      RETURN.
  +    ENDIF.
  +
  +    CLEAR lt_tadir.
  +    INSERT ls_tadir INTO TABLE lt_tadir.
  +
  +    CREATE OBJECT lo_serialize.
  +    lt_new_local_files = lo_serialize->serialize(
  +      iv_package = ms_data-package
  +      it_tadir   = lt_tadir ).
  +
  +    INSERT LINES OF lt_new_local_files INTO TABLE mt_local.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD refresh_local_objects.
  +
  +    mv_request_local_refresh = abap_true.
  +    get_files_local( ).
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD remove_ignored_files.
  +
  +    DATA lo_dot TYPE REF TO zcl_abapgit_dot_abapgit.
  +    DATA lv_index TYPE sy-index.
  +
  +    FIELD-SYMBOLS <ls_files> LIKE LINE OF ct_files.
  +
  +    lo_dot = get_dot_abapgit( ).
  +
  +    " Skip ignored files
  +    LOOP AT ct_files ASSIGNING <ls_files>.
  +      lv_index = sy-tabix.
  +      IF lo_dot->is_ignored( iv_path     = <ls_files>-path
  +                             iv_filename = <ls_files>-filename ) = abap_true.
  +        DELETE ct_files INDEX lv_index.
  +      ENDIF.
  +    ENDLOOP.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD reset_remote.
  +    CLEAR mt_remote.
  +    mv_request_remote_refresh = abap_true.
  +    reset_status( ).
  +  ENDMETHOD.
  +
  +
  +  METHOD reset_status.
  +    CLEAR mt_status.
  +  ENDMETHOD.
  +
  +
  +  METHOD set.
  +
  +* TODO: refactor, maybe use zcl_abapgit_string_map ?
  +
  +    DATA: ls_mask TYPE zif_abapgit_persistence=>ty_repo_meta_mask.
  +
  +
  +    ASSERT iv_url IS SUPPLIED
  +      OR iv_branch_name IS SUPPLIED
  +      OR iv_selected_commit IS SUPPLIED
  +      OR iv_head_branch IS SUPPLIED
  +      OR iv_offline IS SUPPLIED
  +      OR is_dot_abapgit IS SUPPLIED
  +      OR is_local_settings IS SUPPLIED
  +      OR iv_deserialized_by IS SUPPLIED
  +      OR iv_deserialized_at IS SUPPLIED
  +      OR iv_switched_origin IS SUPPLIED.
  +
  +
  +    IF iv_url IS SUPPLIED.
  +      ms_data-url = iv_url.
  +      ls_mask-url = abap_true.
  +    ENDIF.
  +
  +    IF iv_branch_name IS SUPPLIED.
  +      ms_data-branch_name = iv_branch_name.
  +      ls_mask-branch_name = abap_true.
  +    ENDIF.
  +
  +    IF iv_selected_commit IS SUPPLIED.
  +      ms_data-selected_commit = iv_selected_commit.
  +      ls_mask-selected_commit = abap_true.
  +    ENDIF.
  +
  +    IF iv_head_branch IS SUPPLIED.
  +      ms_data-head_branch = iv_head_branch.
  +      ls_mask-head_branch = abap_true.
  +    ENDIF.
  +
  +    IF iv_offline IS SUPPLIED.
  +      ms_data-offline = iv_offline.
  +      ls_mask-offline = abap_true.
  +    ENDIF.
  +
  +    IF is_dot_abapgit IS SUPPLIED.
  +      ms_data-dot_abapgit = is_dot_abapgit.
  +      ls_mask-dot_abapgit = abap_true.
  +    ENDIF.
  +
  +    IF is_local_settings IS SUPPLIED.
  +      ms_data-local_settings = is_local_settings.
  +      ls_mask-local_settings = abap_true.
  +    ENDIF.
  +
  +    IF iv_deserialized_at IS SUPPLIED OR iv_deserialized_by IS SUPPLIED.
  +      ms_data-deserialized_at = iv_deserialized_at.
  +      ms_data-deserialized_by = iv_deserialized_by.
  +      ls_mask-deserialized_at = abap_true.
  +      ls_mask-deserialized_by = abap_true.
  +    ENDIF.
  +
  +    IF iv_switched_origin IS SUPPLIED.
  +      ms_data-switched_origin = iv_switched_origin.
  +      ls_mask-switched_origin = abap_true.
  +    ENDIF.
  +
  +    notify_listener( ls_mask ).
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD set_dot_apack.
  +    get_dot_apack( ).
  +    mo_apack_reader->set_manifest_descriptor( io_dot_apack->get_manifest_descriptor( ) ).
  +  ENDMETHOD.
  +
  +
  +  METHOD set_files_remote.
  +
  +    mt_remote = it_files.
  +    mv_request_remote_refresh = abap_false.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD set_local_settings.
  +
  +    set( is_local_settings = is_settings ).
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD status.
  +
  +    IF lines( mt_status ) = 0.
  +      mt_status = zcl_abapgit_file_status=>status( io_repo = me
  +                                                   ii_log  = ii_log ).
  +
  +    ENDIF.
  +
  +    rt_results = mt_status.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD switch_repo_type.
  +
  +    IF iv_offline = ms_data-offline.
  +      zcx_abapgit_exception=>raise( |Cannot switch_repo_type, offline already = "{ ms_data-offline }"| ).
  +    ENDIF.
  +
  +    IF iv_offline = abap_true. " On-line -> OFFline
  +      set( iv_url             = zcl_abapgit_url=>name( ms_data-url )
  +           iv_branch_name     = ''
  +           iv_selected_commit = ''
  +           iv_head_branch     = ''
  +           iv_offline         = abap_true ).
  +    ELSE. " OFFline -> On-line
  +      set( iv_offline = abap_false ).
  +    ENDIF.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD update_last_deserialize.
  +
  +    DATA: lv_deserialized_at TYPE zif_abapgit_persistence=>ty_repo-deserialized_at,
  +          lv_deserialized_by TYPE zif_abapgit_persistence=>ty_repo-deserialized_by.
  +
  +    GET TIME STAMP FIELD lv_deserialized_at.
  +    lv_deserialized_by = sy-uname.
  +
  +    set( iv_deserialized_at = lv_deserialized_at
  +         iv_deserialized_by = lv_deserialized_by ).
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD zif_abapgit_repo~checksums.
  +
  +    CREATE OBJECT ri_checksums TYPE zcl_abapgit_repo_checksums
  +      EXPORTING
  +        iv_repo_key = ms_data-key.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD zif_abapgit_repo~deserialize.
   
       DATA: lt_updated_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt,
             lt_result        TYPE zif_abapgit_data_deserializer=>ty_results,
  
positive.code: 
  
  
  CLASS ZCL_ABAPGIT_REPO IMPLEMENTATION.
  
    METHOD check_and_create_package.
  
  
negative.code:   ENDMETHOD.
  
  
    METHOD zif_abapgit_repo~get_dot_abapgit.
      CREATE OBJECT ro_dot_abapgit
        EXPORTING
          is_data = ms_data-dot_abapgit.
    ENDMETHOD.
  
  
    METHOD zif_abapgit_repo~get_files_local.
  
      DATA lo_serialize TYPE REF TO zcl_abapgit_serialize.
      DATA lt_filter TYPE zif_abapgit_definitions=>ty_tadir_tt.
  