mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
heh, this code is a mess, and need to add unit tests for it sometime
This commit is contained in:
parent
38837c3268
commit
ab0d1a3fa6
|
@ -80,7 +80,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS zcl_abapgit_merge IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD all_files.
|
METHOD all_files.
|
||||||
|
@ -96,18 +96,6 @@ CLASS zcl_abapgit_merge IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD calculate_result.
|
METHOD calculate_result.
|
||||||
|
|
||||||
DEFINE _from_source.
|
|
||||||
READ TABLE mt_objects ASSIGNING <ls_object>
|
|
||||||
WITH KEY type COMPONENTS
|
|
||||||
type = zif_abapgit_definitions=>c_type-blob
|
|
||||||
sha1 = <ls_source>-sha1.
|
|
||||||
ASSERT sy-subrc = 0.
|
|
||||||
|
|
||||||
ms_merge-stage->add( iv_path = <ls_file>-path
|
|
||||||
iv_filename = <ls_file>-name
|
|
||||||
iv_data = <ls_object>-data ).
|
|
||||||
END-OF-DEFINITION.
|
|
||||||
|
|
||||||
DATA: lt_files TYPE zif_abapgit_definitions=>ty_expanded_tt,
|
DATA: lt_files TYPE zif_abapgit_definitions=>ty_expanded_tt,
|
||||||
lv_found_source TYPE abap_bool,
|
lv_found_source TYPE abap_bool,
|
||||||
lv_found_target TYPE abap_bool,
|
lv_found_target TYPE abap_bool,
|
||||||
|
@ -168,7 +156,15 @@ CLASS zcl_abapgit_merge IMPLEMENTATION.
|
||||||
|
|
||||||
IF lv_found_target = abap_false.
|
IF lv_found_target = abap_false.
|
||||||
* added in source
|
* added in source
|
||||||
_from_source.
|
READ TABLE mt_objects ASSIGNING <ls_object>
|
||||||
|
WITH KEY type COMPONENTS
|
||||||
|
type = zif_abapgit_definitions=>c_type-blob
|
||||||
|
sha1 = <ls_source>-sha1.
|
||||||
|
ASSERT sy-subrc = 0.
|
||||||
|
|
||||||
|
ms_merge-stage->add( iv_path = <ls_file>-path
|
||||||
|
iv_filename = <ls_file>-name
|
||||||
|
iv_data = <ls_object>-data ).
|
||||||
<ls_result>-sha1 = <ls_source>-sha1.
|
<ls_result>-sha1 = <ls_source>-sha1.
|
||||||
CONTINUE.
|
CONTINUE.
|
||||||
ELSEIF lv_found_source = abap_false.
|
ELSEIF lv_found_source = abap_false.
|
||||||
|
@ -215,7 +211,15 @@ CLASS zcl_abapgit_merge IMPLEMENTATION.
|
||||||
<ls_result>-sha1 = <ls_source>-sha1.
|
<ls_result>-sha1 = <ls_source>-sha1.
|
||||||
ELSEIF <ls_target>-sha1 = <ls_common>-sha1.
|
ELSEIF <ls_target>-sha1 = <ls_common>-sha1.
|
||||||
* changed in source
|
* changed in source
|
||||||
_from_source.
|
READ TABLE mt_objects ASSIGNING <ls_object>
|
||||||
|
WITH KEY type COMPONENTS
|
||||||
|
type = zif_abapgit_definitions=>c_type-blob
|
||||||
|
sha1 = <ls_source>-sha1.
|
||||||
|
ASSERT sy-subrc = 0.
|
||||||
|
|
||||||
|
ms_merge-stage->add( iv_path = <ls_file>-path
|
||||||
|
iv_filename = <ls_file>-name
|
||||||
|
iv_data = <ls_object>-data ).
|
||||||
<ls_result>-sha1 = <ls_source>-sha1.
|
<ls_result>-sha1 = <ls_source>-sha1.
|
||||||
ELSEIF <ls_source>-sha1 = <ls_common>-sha1.
|
ELSEIF <ls_source>-sha1 = <ls_common>-sha1.
|
||||||
* changed in target
|
* changed in target
|
||||||
|
|
Loading…
Reference in New Issue
Block a user