All files / output zcl_abapgit_flow_git.clas.locals.mjs

75.74% Statements 203/268
68.42% Branches 13/19
29.41% Functions 10/34
75.74% Lines 203/268

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 2681x 1x 4x 4x 4x 4x 4x         4x 4x         4x 4x       1x 1x     1x 1x         1x 1x       4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x           4x 4x 4x 4x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 4x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x                                                     2x                             2x 2x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 4x 4x 4x 1x 1x 1x 1x 1x 1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_flow_git.clas.locals_imp.abap
class lcl_find_changes {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_FLOW_GIT-LCL_FIND_CHANGES';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {"MT_TREE_CACHE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "sha1": new abap.types.String({qualifiedName: "LCL_FIND_CHANGES=>TY_TREE_CACHE-SHA1"}),
  "nodes": abap.types.TableFactory.construct(new abap.types.Structure({
  "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
  "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_git_pack=>ty_nodes_tt")}, "lcl_find_changes=>ty_tree_cache", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["SHA1"]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MT_OBJECTS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
  "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
  "adler32": new abap.types.Hex({length: 4}),
  "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"sha","type":"SORTED","isUnique":false,"keyFields":["SHA1"]},{"name":"type","type":"SORTED","isUnique":false,"keyFields":["TYPE","SHA1"]}]}, "zif_abapgit_definitions=>ty_objects_tt");}, "visibility": "I", "is_constant": " ", "is_class": " "}};
  static METHODS = {"WALK": {"visibility": "I", "parameters": {"RT_FILES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-PATH"}),
  "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-FILENAME"}),
  "remote_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "local_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zif_abapgit_flow_logic=>ty_path_name", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["PATH","FILENAME"]},"secondary":[]}, "zif_abapgit_flow_logic=>ty_path_name_tt");}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_TREE_MAIN": {"type": () => {return new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});}, "is_optional": " "}, "IV_TREE_BRANCH": {"type": () => {return new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});}, "is_optional": " "}}},
  "DECODE_TREE": {"visibility": "I", "parameters": {"RT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
  "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_git_pack=>ty_nodes_tt");}, "is_optional": " "}, "IV_TREE": {"type": () => {return new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});}, "is_optional": " "}}},
  "CONSTRUCTOR": {"visibility": "U", "parameters": {"IT_OBJECTS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
  "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
  "adler32": new abap.types.Hex({length: 4}),
  "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"sha","type":"SORTED","isUnique":false,"keyFields":["SHA1"]},{"name":"type","type":"SORTED","isUnique":false,"keyFields":["TYPE","SHA1"]}]}, "zif_abapgit_definitions=>ty_objects_tt");}, "is_optional": " "}}},
  "FIND_CHANGES": {"visibility": "U", "parameters": {"RT_FILES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-PATH"}),
  "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-FILENAME"}),
  "remote_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "local_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zif_abapgit_flow_logic=>ty_path_name", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["PATH","FILENAME"]},"secondary":[]}, "zif_abapgit_flow_logic=>ty_path_name_tt");}, "is_optional": " "}, "IV_MAIN": {"type": () => {return new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});}, "is_optional": " "}, "IV_BRANCH": {"type": () => {return new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});}, "is_optional": " "}, "IV_STARTING_FOLDER": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}};
  #mt_tree_cache;
  #mt_objects;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "walk": this.#walk.bind(this),
      "decode_tree": this.#decode_tree.bind(this),
      "find_changes": this.find_changes.bind(this),
    };
    this.#mt_tree_cache = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.String({qualifiedName: "LCL_FIND_CHANGES=>TY_TREE_CACHE-SHA1"}),
    "nodes": abap.types.TableFactory.construct(new abap.types.Structure({
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
    "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_git_pack=>ty_nodes_tt")}, "lcl_find_changes=>ty_tree_cache", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["SHA1"]},"secondary":[]}, "");
    this.FRIENDS_ACCESS_INSTANCE["mt_tree_cache"] = this.#mt_tree_cache;
    this.#mt_objects = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
    "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
    "adler32": new abap.types.Hex({length: 4}),
    "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"sha","type":"SORTED","isUnique":false,"keyFields":["SHA1"]},{"name":"type","type":"SORTED","isUnique":false,"keyFields":["TYPE","SHA1"]}]}, "zif_abapgit_definitions=>ty_objects_tt");
    this.FRIENDS_ACCESS_INSTANCE["mt_objects"] = this.#mt_objects;
  }
  async constructor_(INPUT) {
    let it_objects = INPUT?.it_objects;
    if (it_objects?.getQualifiedName === undefined || it_objects.getQualifiedName() !== "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECTS_TT") { it_objects = undefined; }
    if (it_objects === undefined) { it_objects = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
    "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
    "adler32": new abap.types.Hex({length: 4}),
    "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"sha","type":"SORTED","isUnique":false,"keyFields":["SHA1"]},{"name":"type","type":"SORTED","isUnique":false,"keyFields":["TYPE","SHA1"]}]}, "zif_abapgit_definitions=>ty_objects_tt").set(INPUT.it_objects); }
    this.#mt_objects.set(it_objects);
    return this;
  }
  async find_changes(INPUT) {
    let rt_files = abap.types.TableFactory.construct(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-PATH"}),
    "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-FILENAME"}),
    "remote_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "local_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zif_abapgit_flow_logic=>ty_path_name", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["PATH","FILENAME"]},"secondary":[]}, "zif_abapgit_flow_logic=>ty_path_name_tt");
    let iv_main = INPUT?.iv_main;
    if (iv_main?.getQualifiedName === undefined || iv_main.getQualifiedName() !== "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_SHA1") { iv_main = undefined; }
    if (iv_main === undefined) { iv_main = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}).set(INPUT.iv_main); }
    let iv_branch = INPUT?.iv_branch;
    if (iv_branch?.getQualifiedName === undefined || iv_branch.getQualifiedName() !== "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_SHA1") { iv_branch = undefined; }
    if (iv_branch === undefined) { iv_branch = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}).set(INPUT.iv_branch); }
    let iv_starting_folder = INPUT?.iv_starting_folder;
    if (iv_starting_folder?.getQualifiedName === undefined || iv_starting_folder.getQualifiedName() !== "STRING") { iv_starting_folder = undefined; }
    if (iv_starting_folder === undefined) { iv_starting_folder = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_starting_folder); }
    let ls_object = new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
    "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
    "adler32": new abap.types.Hex({length: 4}),
    "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {});
    let lv_tree_main = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});
    let lv_tree_branch = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});
    abap.statements.readTable(this.#mt_objects,{keyName: "type",
      withTableKey: true,
      into: ls_object,
      withKey: (i) => {return abap.compare.eq(i.sha1, iv_main) && abap.compare.eq(i.type, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().commit);},
      withKeyValue: [{key: (i) => {return i.sha1}, value: iv_main},{key: (i) => {return i.type}, value: abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().commit}],
      usesTableLine: false,
      withKeySimple: {"sha1": iv_main,"type": abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().commit}});
    abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
    lv_tree_main.set(((await abap.Classes['ZCL_ABAPGIT_GIT_PACK'].decode_commit({iv_data: ls_object.get().data}))).get().tree);
    abap.statements.readTable(this.#mt_objects,{keyName: "type",
      withTableKey: true,
      into: ls_object,
      withKey: (i) => {return abap.compare.eq(i.sha1, iv_branch) && abap.compare.eq(i.type, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().commit);},
      withKeyValue: [{key: (i) => {return i.sha1}, value: iv_branch},{key: (i) => {return i.type}, value: abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().commit}],
      usesTableLine: false,
      withKeySimple: {"sha1": iv_branch,"type": abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().commit}});
    abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
    lv_tree_branch.set(((await abap.Classes['ZCL_ABAPGIT_GIT_PACK'].decode_commit({iv_data: ls_object.get().data}))).get().tree);
    rt_files.set((await this.#walk({iv_path: abap.CharacterFactory.get(1, '/'), iv_tree_main: lv_tree_main, iv_tree_branch: lv_tree_branch})));
    await abap.statements.deleteInternal(rt_files,{where: async (I) => {return abap.compare.np(I.path, iv_starting_folder);}});
    return rt_files;
  }
  async #walk(INPUT) {
    let rt_files = abap.types.TableFactory.construct(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-PATH"}),
    "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-FILENAME"}),
    "remote_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "local_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zif_abapgit_flow_logic=>ty_path_name", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["PATH","FILENAME"]},"secondary":[]}, "zif_abapgit_flow_logic=>ty_path_name_tt");
    let iv_path = INPUT?.iv_path;
    if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; }
    if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); }
    let iv_tree_main = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});
    if (INPUT && INPUT.iv_tree_main) {iv_tree_main.set(INPUT.iv_tree_main);}
    let iv_tree_branch = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});
    if (INPUT && INPUT.iv_tree_branch) {iv_tree_branch.set(INPUT.iv_tree_branch);}
    let lt_main = abap.types.TableFactory.construct(new abap.types.Structure({
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
    "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_git_pack=>ty_nodes_tt");
    let lt_branch = abap.types.TableFactory.construct(new abap.types.Structure({
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
    "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_git_pack=>ty_nodes_tt");
    let ls_node_main = new abap.types.Structure({
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
    "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {});
    let ls_node_branch = new abap.types.Structure({
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
    "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {});
    let ls_file = new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-PATH"}),
    "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-FILENAME"}),
    "remote_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "local_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zif_abapgit_flow_logic=>ty_path_name", undefined, {}, {});
    let lt_files = abap.types.TableFactory.construct(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-PATH"}),
    "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_FLOW_LOGIC=>TY_PATH_NAME-FILENAME"}),
    "remote_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "local_sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zif_abapgit_flow_logic=>ty_path_name", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["PATH","FILENAME"]},"secondary":[]}, "zif_abapgit_flow_logic=>ty_path_name_tt");
    if (abap.compare.initial(iv_tree_main) === false) {
      lt_main.set((await this.#decode_tree({iv_tree: iv_tree_main})));
    }
    if (abap.compare.initial(iv_tree_branch) === false) {
      lt_branch.set((await this.#decode_tree({iv_tree: iv_tree_branch})));
    }
    for await (const unique694 of abap.statements.loop(lt_main)) {
      ls_node_main.set(unique694);
      ls_node_branch.clear();
      abap.statements.readTable(lt_branch,{into: ls_node_branch,
        withKey: (i) => {return abap.compare.eq(i.name, ls_node_main.get().name);},
        withKeyValue: [{key: (i) => {return i.name}, value: ls_node_main.get().name}],
        usesTableLine: false,
        withKeySimple: {"name": ls_node_main.get().name}});
      if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.statements.deleteInternal(lt_branch,{index: abap.builtin.sy.get().tabix});
        if (abap.compare.eq(ls_node_branch.get().sha1, ls_node_main.get().sha1)) {
          continue;
        }
      }
      let unique695 = ls_node_main.get().chmod;
      if (abap.compare.eq(unique695, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_chmod.get().dir)) {
        lt_files.set((await this.#walk({iv_path: abap.operators.concat(iv_path,abap.operators.concat(ls_node_main.get().name,abap.CharacterFactory.get(1, '/'))), iv_tree_main: ls_node_main.get().sha1, iv_tree_branch: ls_node_branch.get().sha1})));
        abap.statements.insertInternal({lines: true, data: lt_files, table: rt_files});
      } else if (abap.compare.eq(unique695, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_chmod.get().file)) {
        ls_file.clear();
        ls_file.get().path.set(iv_path);
        ls_file.get().filename.set(ls_node_main.get().name);
        ls_file.get().remote_sha1.set(ls_node_branch.get().sha1);
        abap.statements.insertInternal({data: ls_file, table: rt_files});
      } else {
      }
    }
    for await (const unique696 of abap.statements.loop(lt_branch)) {
      ls_node_branch.set(unique696);
      let unique697 = ls_node_branch.get().chmod;
      if (abap.compare.eq(unique697, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_chmod.get().dir)) {
        lt_files.set((await this.#walk({iv_path: abap.operators.concat(iv_path,abap.operators.concat(ls_node_branch.get().name,abap.CharacterFactory.get(1, '/'))), iv_tree_branch: ls_node_branch.get().sha1})));
        abap.statements.insertInternal({lines: true, data: lt_files, table: rt_files});
      } else if (abap.compare.eq(unique697, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_chmod.get().file)) {
        ls_file.clear();
        ls_file.get().path.set(iv_path);
        ls_file.get().filename.set(ls_node_branch.get().name);
        ls_file.get().remote_sha1.set(ls_node_branch.get().sha1);
        abap.statements.insertInternal({data: ls_file, table: rt_files});
      } else {
      }
    }
    return rt_files;
  }
  async #decode_tree(INPUT) {
    let rt_nodes = abap.types.TableFactory.construct(new abap.types.Structure({
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
    "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_git_pack=>ty_nodes_tt");
    let iv_tree = INPUT?.iv_tree;
    if (iv_tree?.getQualifiedName === undefined || iv_tree.getQualifiedName() !== "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_SHA1") { iv_tree = undefined; }
    if (iv_tree === undefined) { iv_tree = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}).set(INPUT.iv_tree); }
    let ls_cache = new abap.types.Structure({
    "sha1": new abap.types.String({qualifiedName: "LCL_FIND_CHANGES=>TY_TREE_CACHE-SHA1"}),
    "nodes": abap.types.TableFactory.construct(new abap.types.Structure({
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
    "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_git_pack=>ty_nodes_tt")}, "lcl_find_changes=>ty_tree_cache", undefined, {}, {});
    let ls_object = new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
    "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
    "adler32": new abap.types.Hex({length: 4}),
    "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {});
    let fs_ls_cache_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "sha1": new abap.types.String({qualifiedName: "LCL_FIND_CHANGES=>TY_TREE_CACHE-SHA1"}),
    "nodes": abap.types.TableFactory.construct(new abap.types.Structure({
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
    "name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_git_pack=>ty_nodes_tt")}, "lcl_find_changes=>ty_tree_cache", undefined, {}, {}));
    abap.statements.readTable(this.#mt_tree_cache,{assigning: fs_ls_cache_,
      withKey: (i) => {return abap.compare.eq(i.sha1, iv_tree);},
      withKeyValue: [{key: (i) => {return i.sha1}, value: iv_tree}],
      usesTableLine: false,
      withKeySimple: {"sha1": iv_tree}});
    if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
      rt_nodes.set(fs_ls_cache_.get().nodes);
    } else {
      abap.statements.readTable(this.#mt_objects,{keyName: "type",
        withTableKey: true,
        into: ls_object,
        withKey: (i) => {return abap.compare.eq(i.sha1, iv_tree) && abap.compare.eq(i.type, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().tree);},
        withKeyValue: [{key: (i) => {return i.sha1}, value: iv_tree},{key: (i) => {return i.type}, value: abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().tree}],
        usesTableLine: false,
        withKeySimple: {"sha1": iv_tree,"type": abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().tree}});
      abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
      rt_nodes.set((await abap.Classes['ZCL_ABAPGIT_GIT_PACK'].decode_tree({iv_data: ls_object.get().data})));
      ls_cache.get().sha1.set(iv_tree);
      ls_cache.get().nodes.set(rt_nodes);
      abap.statements.insertInternal({data: ls_cache, table: this.#mt_tree_cache});
    }
    return rt_nodes;
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_FLOW_GIT-LCL_FIND_CHANGES'] = lcl_find_changes;
lcl_find_changes.ty_tree_cache = new abap.types.Structure({
"sha1": new abap.types.String({qualifiedName: "LCL_FIND_CHANGES=>TY_TREE_CACHE-SHA1"}),
"nodes": abap.types.TableFactory.construct(new abap.types.Structure({
"chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"}),
"name": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GIT_PACK=>TY_NODE-NAME"}),
"sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"})}, "zcl_abapgit_git_pack=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_git_pack=>ty_nodes_tt")}, "lcl_find_changes=>ty_tree_cache", undefined, {}, {});
export {lcl_find_changes};