mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 04:08:27 +08:00
Improve secondary key access (#4801)
This commit is contained in:
parent
ad244abacd
commit
53dec3d2e8
|
@ -127,7 +127,8 @@ CLASS zcl_abapgit_git_branch_list IMPLEMENTATION.
|
|||
ELSE.
|
||||
|
||||
READ TABLE mt_branches INTO rs_branch
|
||||
WITH KEY name = iv_branch_name.
|
||||
WITH TABLE KEY name_key
|
||||
COMPONENTS name = iv_branch_name.
|
||||
IF sy-subrc <> 0.
|
||||
zcx_abapgit_exception=>raise( |Branch { get_display_name( iv_branch_name )
|
||||
} not found. Use 'Branch' > 'Switch' to select a different branch| ).
|
||||
|
@ -145,11 +146,13 @@ CLASS zcl_abapgit_git_branch_list IMPLEMENTATION.
|
|||
lv_branch_name = iv_branch_name && '^{}'.
|
||||
|
||||
READ TABLE mt_branches INTO rs_branch
|
||||
WITH KEY name = lv_branch_name.
|
||||
WITH TABLE KEY name_key
|
||||
COMPONENTS name = lv_branch_name.
|
||||
IF sy-subrc <> 0.
|
||||
|
||||
READ TABLE mt_branches INTO rs_branch
|
||||
WITH KEY name = iv_branch_name.
|
||||
WITH TABLE KEY name_key
|
||||
COMPONENTS name = iv_branch_name.
|
||||
IF sy-subrc <> 0.
|
||||
zcx_abapgit_exception=>raise( 'Branch not found' ).
|
||||
ENDIF.
|
||||
|
|
|
@ -45,7 +45,9 @@ CLASS ltcl_parse IMPLEMENTATION.
|
|||
act = lines( lt_list )
|
||||
exp = iv_expected_lines ).
|
||||
|
||||
READ TABLE lt_list WITH KEY name = zif_abapgit_definitions=>c_git_branch-main TRANSPORTING NO FIELDS.
|
||||
READ TABLE lt_list WITH TABLE KEY name_key
|
||||
COMPONENTS name = zif_abapgit_definitions=>c_git_branch-main
|
||||
TRANSPORTING NO FIELDS.
|
||||
cl_abap_unit_assert=>assert_subrc( ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -132,7 +132,8 @@ CLASS zcl_abapgit_branch_overview IMPLEMENTATION.
|
|||
|
||||
|
||||
* Exchange HEAD, and make sure the branch determination starts with the HEAD branch
|
||||
READ TABLE mt_branches ASSIGNING <ls_head> WITH KEY name = lc_head.
|
||||
READ TABLE mt_branches ASSIGNING <ls_head>
|
||||
WITH TABLE KEY name_key COMPONENTS name = lc_head.
|
||||
ASSERT sy-subrc = 0.
|
||||
LOOP AT mt_branches ASSIGNING <ls_branch>
|
||||
WHERE sha1 = <ls_head>-sha1 AND name <> lc_head.
|
||||
|
|
Loading…
Reference in New Issue
Block a user