From bb2423445ea8ae43ea215ef58cb909abec0a91db Mon Sep 17 00:00:00 2001 From: Marc Bernard <59966492+mbtools@users.noreply.github.com> Date: Thu, 30 Nov 2023 03:25:13 -0500 Subject: [PATCH] Fix running multiple instances of abapGit (#6679) Co-authored-by: Lars Hvam --- .../zcl_abapgit_persistence_repo.clas.abap | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/persist/zcl_abapgit_persistence_repo.clas.abap b/src/persist/zcl_abapgit_persistence_repo.clas.abap index d2251aae2..48d8fef62 100644 --- a/src/persist/zcl_abapgit_persistence_repo.clas.abap +++ b/src/persist/zcl_abapgit_persistence_repo.clas.abap @@ -41,7 +41,7 @@ CLASS zcl_abapgit_persistence_repo DEFINITION zcx_abapgit_exception . METHODS get_repo_from_content IMPORTING - is_content TYPE zif_abapgit_persistence=>ty_content + is_content TYPE zif_abapgit_persistence=>ty_content RETURNING VALUE(rs_result) TYPE zif_abapgit_persistence=>ty_repo RAISING @@ -50,7 +50,7 @@ ENDCLASS. -CLASS ZCL_ABAPGIT_PERSISTENCE_REPO IMPLEMENTATION. +CLASS zcl_abapgit_persistence_repo IMPLEMENTATION. METHOD constructor. @@ -158,10 +158,14 @@ CLASS ZCL_ABAPGIT_PERSISTENCE_REPO IMPLEMENTATION. MOVE-CORRESPONDING from_xml( lv_old_blob ) TO ls_repo_meta. lv_new_blob = to_xml( ls_repo_meta ). - mo_db->update( - iv_type = zcl_abapgit_persistence_db=>c_type_repo - iv_value = iv_repo_key - iv_data = lv_new_blob ). + IF lv_new_blob <> lv_old_blob. + mo_db->update( + iv_type = zcl_abapgit_persistence_db=>c_type_repo + iv_value = iv_repo_key + iv_data = lv_new_blob ). + + COMMIT WORK. + ENDIF. ENDMETHOD.