Commits created with GitHub UI causes a runtime error.
Steps to reproduce:
activate commit signing with GPG on your GitHub-profile
create a commit on www.github.com with GitHub UI
checkout the repository locally git pull https://github.com/user/repo
push to abapGitServer git push http://host/sap/zabapgitserver/git/repo.git
The hash calculated by GitHub and the hash calculated by abapGitServer doesn't match. It fails in method zcl_ags_pack=>save
METHOD save.
DATA: li_object TYPE REF TO zif_ags_object.
FIELD-SYMBOLS: <ls_object> LIKE LINE OF it_objects.
ASSERT NOT iv_repo IS INITIAL.
LOOP AT it_objects ASSIGNING <ls_object>.
CASE <ls_object>-type.
WHEN zif_ags_constants=>c_type-blob.
li_object = zcl_ags_obj_blob=>new( iv_repo ).
WHEN zif_ags_constants=>c_type-tree.
li_object = zcl_ags_obj_tree=>new( iv_repo ).
WHEN zif_ags_constants=>c_type-commit.
li_object = zcl_ags_obj_commit=>new( iv_repo ).
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_ags_error
EXPORTING
textid = zcx_ags_error=>m009.
ENDCASE.
li_object->deserialize( iv_data = <ls_object>-data
iv_adler32 = <ls_object>-adler32 ).
ASSERT li_object->get_sha1( ) = <ls_object>-sha1. " doesn't match
li_object->save( ).
ENDLOOP.
ENDMETHOD.
The SHA1 created by GitHub contains the public GPG-key as you can see with the command (printf "commit %s\0" $(git cat-file commit HEAD | wc -c); git cat-file commit HEAD). abapGitServer ignores the public GPG-key.
Commits created with GitHub UI causes a runtime error. Steps to reproduce:
git pull https://github.com/user/repo
git push http://host/sap/zabapgitserver/git/repo.git
The hash calculated by GitHub and the hash calculated by abapGitServer doesn't match. It fails in method
zcl_ags_pack=>save
The SHA1 created by GitHub contains the public GPG-key as you can see with the command
(printf "commit %s\0" $(git cat-file commit HEAD | wc -c); git cat-file commit HEAD)
. abapGitServer ignores the public GPG-key.