anchor.diff:      ELSEIF sy-subrc <> 0.
         zcx_abapgit_exception=>raise_t100( ).
       ENDIF.
  +
  +  ENDMETHOD.
  +
  +
  +  METHOD remove_obsolete_tadir.
  +
  +    DATA:
  +      lv_pack  TYPE devclass,
  +      lt_pack  TYPE STANDARD TABLE OF devclass,
  +      ls_tadir TYPE zif_abapgit_definitions=>ty_tadir,
  +      lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
  +      ls_item  TYPE zif_abapgit_definitions=>ty_item.
  +
  +    " TADIR entries must remain for transportable packages
  +    IF is_local( iv_package_name ) = abap_false.
  +      RETURN.
  +    ENDIF.
  +
  +    " Clean-up sub packages first
  +    SELECT devclass FROM tdevc INTO TABLE lt_pack WHERE parentcl = iv_package_name.
  +
  +    LOOP AT lt_pack INTO lv_pack.
  +      remove_obsolete_tadir( lv_pack ).
  +    ENDLOOP.
  +
  +    " Remove TADIR entries for objects that do not exist anymore
  +    SELECT * FROM tadir INTO CORRESPONDING FIELDS OF TABLE lt_tadir WHERE devclass = iv_package_name.
  +
  +    LOOP AT lt_tadir INTO ls_tadir.
  +      ls_item-obj_type = ls_tadir-object.
  +      ls_item-obj_name = ls_tadir-obj_name.
  +
  +      IF zcl_abapgit_objects=>exists( ls_item ) = abap_false.
  +        CALL FUNCTION 'TR_TADIR_INTERFACE'
  +          EXPORTING
  +            wi_delete_tadir_entry = abap_true
  +            wi_tadir_pgmid        = 'R3TR'
  +            wi_tadir_object       = ls_tadir-object
  +            wi_tadir_obj_name     = ls_tadir-obj_name
  +            wi_test_modus         = abap_false
  +          EXCEPTIONS
  +            OTHERS                = 1 ##FM_SUBRC_OK.
  +      ENDIF.
  +    ENDLOOP.
   
     ENDMETHOD.
   
  
positive.code:            AND NOT ( object = 'DEVC' AND obj_name = iv_package_name )
             AND devclass = iv_package_name.
      rv_is_empty = boolc( sy-subrc <> 0 ).
  
    ENDMETHOD.
  
  
negative.code:                             iv_language TYPE spras.
    PROTECTED SECTION.
    PRIVATE SECTION.
  
      DATA mv_local_devclass TYPE devclass .
  
      METHODS get_package
        RETURNING
          VALUE(ri_package) TYPE REF TO if_package
        RAISING
          zcx_abapgit_exception .
      METHODS update_pinf_usages
        IMPORTING
          !ii_package    TYPE REF TO if_package
          !it_usage_data TYPE scomppdata
        RAISING
          zcx_abapgit_exception .
      METHODS set_lock
        IMPORTING
          !ii_package TYPE REF TO if_package
          !iv_lock    TYPE abap_bool
        RAISING
          zcx_abapgit_exception .
      METHODS is_empty
        IMPORTING
          !iv_package_name   TYPE devclass
        RETURNING
          VALUE(rv_is_empty) TYPE abap_bool
        RAISING
          zcx_abapgit_exception .
      METHODS load_package
        IMPORTING
          !iv_package_name  TYPE devclass
        RETURNING
          VALUE(ri_package) TYPE REF TO if_package
        RAISING
          zcx_abapgit_exception .
      METHODS is_local
        IMPORTING
          !iv_package_name   TYPE devclass
        RETURNING
          VALUE(rv_is_local) TYPE abap_bool .
      METHODS remove_obsolete_tadir
        IMPORTING
          !iv_package_name TYPE devclass .
  ENDCLASS.
  
  
  