From 211e314844e9f14be364c831c769f4ea124e1004 Mon Sep 17 00:00:00 2001 From: larshp Date: Fri, 25 Nov 2016 15:27:45 +0100 Subject: [PATCH] background mode: fix lets try this instead, getting sloppy --- src/zabapgit_background.prog.abap | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/zabapgit_background.prog.abap b/src/zabapgit_background.prog.abap index 42e25676c..b183c992d 100644 --- a/src/zabapgit_background.prog.abap +++ b/src/zabapgit_background.prog.abap @@ -110,9 +110,10 @@ CLASS lcl_background IMPLEMENTATION. METHOD push_auto. - DATA: ls_comment TYPE ty_comment, - ls_files TYPE ty_stage_files, - lo_stage TYPE REF TO lcl_stage. + DATA: ls_comment TYPE ty_comment, + ls_files TYPE ty_stage_files, + ls_user_files LIKE ls_files, + lo_stage TYPE REF TO lcl_stage. FIELD-SYMBOLS: LIKE LINE OF ls_files-local. @@ -121,7 +122,6 @@ CLASS lcl_background IMPLEMENTATION. ls_files = lcl_stage_logic=>get( io_repo ). DO. - READ TABLE ls_files-local INDEX 1 ASSIGNING . IF sy-subrc <> 0. EXIT. @@ -130,13 +130,14 @@ CLASS lcl_background IMPLEMENTATION. CLEAR ls_comment. ls_comment-username = lcl_objects=>changed_by( -item ). ls_comment-email = |{ ls_comment-username }@localhost|. - ls_comment-comment = build_comment( ls_files ). CREATE OBJECT lo_stage EXPORTING iv_branch_name = io_repo->get_branch_name( ) iv_branch_sha1 = io_repo->get_sha1_remote( ). + CLEAR ls_user_files. + LOOP AT ls_files-local ASSIGNING . IF lcl_objects=>changed_by( -item ) = ls_comment-username. WRITE: / 'stage' ##NO_TEXT, @@ -147,9 +148,13 @@ CLASS lcl_background IMPLEMENTATION. lo_stage->add( iv_path = -file-path iv_filename = -file-filename iv_data = -file-data ). + + APPEND TO ls_user_files-local. ENDIF. ENDLOOP. + ls_comment-comment = build_comment( ls_user_files ). + io_repo->push( is_comment = ls_comment io_stage = lo_stage ).