anchor.diff:  * See http://www.abapgit.org
   
   CONSTANTS: gc_xml_version  TYPE string VALUE 'v1.0.0',      "#EC NOTEXT
  -           gc_abap_version TYPE string VALUE 'v1.12.2'.     "#EC NOTEXT
  +           gc_abap_version TYPE string VALUE 'v1.12.3'.     "#EC NOTEXT
   
   ********************************************************************************
   * The MIT License (MIT)
  
positive.code:       RETURNING VALUE(rv_branch) TYPE ty_sha1
        RAISING   lcx_exception.
  
    PRIVATE SECTION.
      TYPES: BEGIN OF ty_expanded,
               path  TYPE string,
  
negative.code: 
    ENDMETHOD.
  
    METHOD create_branch_popup.
  
      DATA: lv_answer TYPE c LENGTH 1,
            lt_fields TYPE TABLE OF sval.
  
      FIELD-SYMBOLS: <ls_field> LIKE LINE OF lt_fields.
  
  
      CLEAR ev_name.
      CLEAR ev_cancel.
  
  *                   TAB     FLD   LABEL   DEF                       ATTR
      _add_dialog_fld 'TEXTL' 'LINE' 'Name' 'refs/heads/branch_name'  ''.
  
      CALL FUNCTION 'POPUP_GET_VALUES'
        EXPORTING
          popup_title     = 'Create branch'
        IMPORTING
          returncode      = lv_answer
        TABLES
          fields          = lt_fields
        EXCEPTIONS
          error_in_fields = 1
          OTHERS          = 2 ##NO_TEXT.
      IF sy-subrc <> 0.
        _raise 'error from POPUP_GET_VALUES'.
      ENDIF.
  
      IF lv_answer = 'A'.
        ev_cancel = abap_true.
      ELSE.
        READ TABLE lt_fields INDEX 1 ASSIGNING <ls_field>.
        ASSERT sy-subrc = 0.
        ev_name = <ls_field>-value.
      ENDIF.
  
    ENDMETHOD.
  
    METHOD create_branch.
  
      DATA: lv_name   TYPE string,
            lv_cancel TYPE abap_bool,
            lo_repo   TYPE REF TO lcl_repo_online.
  
  
      lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
  
      create_branch_popup(
        IMPORTING
          ev_name   = lv_name
          ev_cancel = lv_cancel ).
      IF lv_cancel = abap_true.
        RETURN.
      ENDIF.
  
      ASSERT lv_name CP 'refs/heads/+*'.
  
      lcl_git_porcelain=>create_branch(
        io_repo = lo_repo
        iv_name = lv_name
        iv_from = lo_repo->get_sha1_local( ) ).
  
  * automatically switch to new branch
      lo_repo->set_branch_name( lv_name ).
  
      MESSAGE 'Switched to new branch' TYPE 'S'.
  
    ENDMETHOD.
  
  