From ffc411b8f14fd620768eae22b35b54c7c1a13674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCnter?= Date: Fri, 14 Jun 2019 08:01:22 +0200 Subject: [PATCH] use remote .abapgit if local repo is empty (#2736) * use remote .abapgit if repo is empty * use method find_remote_dot_abapgit * cleanup * cleanup /2 --- src/zcl_abapgit_file_status.clas.abap | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/zcl_abapgit_file_status.clas.abap b/src/zcl_abapgit_file_status.clas.abap index af3bdc99e..859f79b50 100644 --- a/src/zcl_abapgit_file_status.clas.abap +++ b/src/zcl_abapgit_file_status.clas.abap @@ -404,10 +404,20 @@ CLASS ZCL_ABAPGIT_FILE_STATUS IMPLEMENTATION. METHOD status. DATA: lv_index LIKE sy-tabix, - lo_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit. + lo_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit, + lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt. - FIELD-SYMBOLS LIKE LINE OF rt_results. + FIELD-SYMBOLS: LIKE LINE OF rt_results. + lt_local = io_repo->get_files_local( ii_log = ii_log ). + + IF lines( lt_local ) <= 2. + " Less equal two means that we have only the .abapgit.xml and the package in + " our local repository. In this case we have to update our local .abapgit.xml + " from the remote one. Otherwise we get errors when e.g. the folder starting + " folder is different. + io_repo->find_remote_dot_abapgit( ). + ENDIF. rt_results = calculate_status( iv_devclass = io_repo->get_package( )