Fix filename constr.: Add ext. only if not initial

With this commit we fix the filename construction so that for
objects without file extension the correct filename is constructed.
Before this commit is applied these objects create file names with
an additional dot at the end.
This commit is contained in:
Christian Günter 2019-02-18 16:08:09 +01:00 committed by Lars Hvam
parent ffcd6c82ed
commit a821944e57

View File

@ -204,13 +204,18 @@ CLASS ZCL_ABAPGIT_OBJECTS_FILES IMPLEMENTATION.
ENDIF. ENDIF.
IF iv_extra IS INITIAL. IF iv_extra IS INITIAL.
CONCATENATE lv_obj_name '.' ms_item-obj_type '.' iv_ext CONCATENATE lv_obj_name '.' ms_item-obj_type
INTO rv_filename. "#EC NOTEXT INTO rv_filename. "#EC NOTEXT
ELSE. ELSE.
CONCATENATE lv_obj_name '.' ms_item-obj_type '.' iv_extra '.' iv_ext CONCATENATE lv_obj_name '.' ms_item-obj_type '.' iv_extra
INTO rv_filename. "#EC NOTEXT INTO rv_filename. "#EC NOTEXT
ENDIF. ENDIF.
IF iv_ext IS NOT INITIAL.
CONCATENATE rv_filename '.' iv_ext
INTO rv_filename.
ENDIF.
* handle namespaces * handle namespaces
REPLACE ALL OCCURRENCES OF '/' IN rv_filename WITH '#'. REPLACE ALL OCCURRENCES OF '/' IN rv_filename WITH '#'.
TRANSLATE rv_filename TO LOWER CASE. TRANSLATE rv_filename TO LOWER CASE.