anchor.diff:        CREATE OBJECT lo_files
           EXPORTING
             is_item = ls_item.
  -      lo_files->set_files( it_files ).
  -
  -*      Analyze XML in order to instantiate the proper serializer
  +      lo_files->set_files( lt_remote ).
  +
  +* Analyze XML in order to instantiate the proper serializer
         lo_xml = lo_files->read_xml( ).
   
         li_obj = create_object( is_item     = ls_item
  
positive.code:       get_sha1_remote
          RETURNING VALUE(rv_sha1) TYPE lcl_persistence_repo=>ty_repo-sha1
          RAISING   lcx_exception,
        get_files_remote
          RETURNING VALUE(rt_files) TYPE ty_files_tt
          RAISING   lcx_exception,
        get_objects
          RETURNING VALUE(rt_objects) TYPE lcl_git_pack=>ty_objects_tt
          RAISING   lcx_exception,
        deserialize
          RAISING lcx_exception,
        status
          RETURNING VALUE(rt_results) TYPE lcl_file_status=>ty_results_tt
          RAISING   lcx_exception,
  
negative.code: 
  ENDCLASS.                    "lcl_file_status DEFINITION
  
  CLASS lcl_persistence_db DEFINITION FINAL.
  
    PUBLIC SECTION.
      CONSTANTS:
        c_tabname TYPE tabname VALUE 'ZABAPGIT',
        c_lock    TYPE viewname VALUE 'EZABAPGIT'.
  
      TYPES: ty_type  TYPE c LENGTH 12.
      TYPES: ty_value TYPE c LENGTH 12.
  
      TYPES: BEGIN OF ty_content,
               type     TYPE ty_type,
               value    TYPE ty_value,
               data_str TYPE string,
             END OF ty_content,
             tt_content TYPE SORTED TABLE OF ty_content WITH UNIQUE KEY value.
  
      METHODS list_by_type
        IMPORTING iv_type           TYPE ty_type
        RETURNING VALUE(rt_content) TYPE tt_content.
  
      METHODS list
        RETURNING VALUE(rt_content) TYPE tt_content.
  
      METHODS add
        IMPORTING iv_type  TYPE ty_type
                  iv_value TYPE ty_content-value
                  iv_data  TYPE ty_content-data_str
        RAISING   lcx_exception.
  
      METHODS delete
        IMPORTING iv_type  TYPE ty_type
                  iv_value TYPE ty_content-value
        RAISING   lcx_exception.
  
      METHODS update
        IMPORTING iv_type  TYPE ty_type
                  iv_value TYPE ty_content-value
                  iv_data  TYPE ty_content-data_str
        RAISING   lcx_exception.
  
      METHODS modify
        IMPORTING iv_type  TYPE ty_type
                  iv_value TYPE ty_content-value
                  iv_data  TYPE ty_content-data_str
        RAISING   lcx_exception.
  
      METHODS read
        IMPORTING iv_type        TYPE ty_type
                  iv_value       TYPE ty_content-value
        RETURNING VALUE(rv_data) TYPE ty_content-data_str
        RAISING   lcx_not_found.
  
      METHODS lock
        IMPORTING iv_mode  TYPE enqmode DEFAULT 'E'
                  iv_type  TYPE ty_type
                  iv_value TYPE ty_content-value
        RAISING   lcx_exception.
  
  ENDCLASS.
  
  CLASS lcl_persistence_repo DEFINITION FINAL.
  
    PUBLIC SECTION.
      TYPES: BEGIN OF ty_repo_xml,
               url         TYPE string,
               branch_name TYPE string,
               sha1        TYPE ty_sha1,
               package     TYPE devclass,
               offline     TYPE sap_bool,
             END OF ty_repo_xml.
  
      TYPES: BEGIN OF ty_repo,
               key TYPE lcl_persistence_db=>ty_value.
          INCLUDE TYPE ty_repo_xml.
      TYPES: END OF ty_repo.
      TYPES: tt_repo TYPE STANDARD TABLE OF ty_repo WITH DEFAULT KEY.
  
      METHODS constructor.
  
      METHODS list
        RETURNING VALUE(rt_repos) TYPE tt_repo
        RAISING   lcx_exception.
  
      METHODS update
        IMPORTING iv_key         TYPE ty_repo-key
                  iv_branch_sha1 TYPE ty_sha1
        RAISING   lcx_exception.
  
      METHODS add
        IMPORTING iv_url         TYPE string
                  iv_branch_name TYPE string
                  iv_branch      TYPE ty_sha1 OPTIONAL
                  iv_package     TYPE devclass
                  iv_offline     TYPE sap_bool DEFAULT abap_false
        RETURNING VALUE(rv_key)  TYPE ty_repo-key
        RAISING   lcx_exception.
  
      METHODS delete
        IMPORTING iv_key TYPE ty_repo-key
        RAISING   lcx_exception.
  
      METHODS read
        IMPORTING iv_key         TYPE ty_repo-key
        RETURNING VALUE(rs_repo) TYPE ty_repo
        RAISING   lcx_exception
                  lcx_not_found.
  
      METHODS lock
        IMPORTING iv_mode TYPE enqmode
                  iv_key  TYPE ty_repo-key
        RAISING   lcx_exception.
  
    PRIVATE SECTION.
      CONSTANTS c_type_repo TYPE lcl_persistence_db=>ty_type VALUE 'REPO'.
  
      DATA: mo_db TYPE REF TO lcl_persistence_db.
  
      METHODS from_xml
        IMPORTING iv_repo_xml_string TYPE string
        RETURNING VALUE(rs_repo)     TYPE ty_repo_xml
        RAISING   lcx_exception.
  
      METHODS to_xml
        IMPORTING is_repo                   TYPE ty_repo
        RETURNING VALUE(rv_repo_xml_string) TYPE string.
  
      METHODS get_next_id
        RETURNING VALUE(rv_next_repo_id) TYPE lcl_persistence_db=>ty_content-value
        RAISING   lcx_exception.
  
  ENDCLASS.
  
  *----------------------------------------------------------------------*
  *       CLASS lcl_repo DEFINITION
  *----------------------------------------------------------------------*
  *
  *----------------------------------------------------------------------*
  CLASS lcl_repo DEFINITION ABSTRACT.
  
    PUBLIC SECTION.
      METHODS:
        constructor
          IMPORTING is_data TYPE lcl_persistence_repo=>ty_repo,
        get_key
          RETURNING VALUE(rv_key) TYPE lcl_persistence_db=>ty_value,
        get_name
          RETURNING VALUE(rv_name) TYPE string
          RAISING   lcx_exception,
        get_files_local
          RETURNING VALUE(rt_files) TYPE ty_files_tt
          RAISING   lcx_exception,
        get_files_remote
          RETURNING VALUE(rt_files) TYPE ty_files_tt
          RAISING   lcx_exception,
        get_package
          RETURNING VALUE(rv_package) TYPE lcl_persistence_repo=>ty_repo-package,
        delete
          RAISING lcx_exception,
        deserialize
          RAISING lcx_exception,
        refresh
          RAISING lcx_exception,
        is_offline
          RETURNING VALUE(rv_offline) TYPE abap_bool
          RAISING   lcx_exception.
  
    PROTECTED SECTION.
      DATA: mt_local  TYPE ty_files_tt,
            mt_remote TYPE ty_files_tt,
            ms_data   TYPE lcl_persistence_repo=>ty_repo.
  
  ENDCLASS.                    "lcl_repo DEFINITION
  
  *----------------------------------------------------------------------*
  *       CLASS lcl_object DEFINITION
  *----------------------------------------------------------------------*
  