All files / output zcl_abapgit_git_branch_list.clas.mjs

37.05% Statements 103/278
68.57% Branches 24/35
26.66% Functions 4/15
37.05% Lines 103/278

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 268 269 270 271 272 273 274 275 276 277 2781x 1x                         1x         1x 1x         1x 1x                                                                                                                                                                                                                                                                                                   5x 5x 5x 5x 1x 1x 1x 1x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 11x 11x 11x 1x 1x 11x 4x 4x 4x 4x 4x 4x 1x 1x 10x 3x 3x 3x   3x 3x 3x 7x 7x 7x 7x 7x 7x 11x 3x 3x 11x 5x         4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x 1x 4x 4x         5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x   1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_git_branch_list.clas.abap
class zcl_abapgit_git_branch_list {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_GIT_BRANCH_LIST';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GIT_BRANCH_LIST"];
  static ATTRIBUTES = {"MT_BRANCHES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
  "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
  "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
  "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"name_key","type":"SORTED","isUnique":false,"keyFields":["NAME"]}]}, "zif_abapgit_git_definitions=>ty_git_branch_list_tt");}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_HEAD_SYMREF": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}};
  static METHODS = {"SKIP_FIRST_PKT": {"visibility": "I", "parameters": {"RV_DATA": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_DATA": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "FIND_TAG_BY_NAME": {"visibility": "I", "parameters": {"RS_BRANCH": {"type": () => {return new abap.types.Structure({
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
  "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
  "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
  "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {});}, "is_optional": " "}, "IV_BRANCH_NAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "PARSE_BRANCH_LIST": {"visibility": "I", "parameters": {"IV_DATA": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "ET_LIST": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
  "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
  "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
  "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"name_key","type":"SORTED","isUnique":false,"keyFields":["NAME"]}]}, "zif_abapgit_git_definitions=>ty_git_branch_list_tt");}, "is_optional": " "}, "EV_HEAD_SYMREF": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "PARSE_HEAD_PARAMS": {"visibility": "I", "parameters": {"RV_HEAD_SYMREF": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_DATA": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "CONSTRUCTOR": {"visibility": "U", "parameters": {"IV_DATA": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}};
  #mt_branches;
  #mv_head_symref;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "find_tag_by_name": this.#find_tag_by_name.bind(this),
    };
    this.#mt_branches = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"name_key","type":"SORTED","isUnique":false,"keyFields":["NAME"]}]}, "zif_abapgit_git_definitions=>ty_git_branch_list_tt");
    this.FRIENDS_ACCESS_INSTANCE["mt_branches"] = this.#mt_branches;
    this.#mv_head_symref = new abap.types.String({qualifiedName: "STRING"});
    this.FRIENDS_ACCESS_INSTANCE["mv_head_symref"] = this.#mv_head_symref;
  }
  async constructor_(INPUT) {
    let iv_data = INPUT?.iv_data;
    if (iv_data?.getQualifiedName === undefined || iv_data.getQualifiedName() !== "STRING") { iv_data = undefined; }
    if (iv_data === undefined) { iv_data = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_data); }
    await this.parse_branch_list({iv_data: iv_data, et_list: this.#mt_branches, ev_head_symref: this.#mv_head_symref});
    return this;
  }
  async zif_abapgit_git_branch_list$find_by_name(INPUT) {
    let rs_branch = new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {});
    let iv_branch_name = INPUT?.iv_branch_name;
    if (abap.compare.initial(iv_branch_name)) {
      await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(17, 'Branch name empty')});
    }
    if (abap.compare.cp(iv_branch_name, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch.get().tags)) {
      rs_branch.set((await this.#find_tag_by_name({iv_branch_name: iv_branch_name})));
    } else {
      abap.statements.readTable(this.#mt_branches,{keyName: "name_key",
        withTableKey: true,
        into: rs_branch,
        withKey: (i) => {return abap.compare.eq(i.name, iv_branch_name);},
        withKeyValue: [{key: (i) => {return i.name}, value: iv_branch_name}],
        usesTableLine: false,
        withKeySimple: {"name": iv_branch_name}});
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`${abap.templateFormatting((await abap.Classes['ZCL_ABAPGIT_GIT_BRANCH_UTILS'].get_description({iv_branch_name: iv_branch_name})))} not found`)});
      }
    }
    return rs_branch;
  }
  async #find_tag_by_name(INPUT) {
    let rs_branch = new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {});
    let iv_branch_name = INPUT?.iv_branch_name;
    if (iv_branch_name?.getQualifiedName === undefined || iv_branch_name.getQualifiedName() !== "STRING") { iv_branch_name = undefined; }
    if (iv_branch_name === undefined) { iv_branch_name = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_branch_name); }
    const unique121 = (await abap.Classes['ZCL_ABAPGIT_GIT_TAG'].add_peel({iv_text: iv_branch_name}));
    abap.statements.readTable(this.#mt_branches,{keyName: "name_key",
      withTableKey: true,
      into: rs_branch,
      withKey: (i) => {return abap.compare.eq(i.name, unique121);},
      withKeyValue: [{key: (i) => {return i.name}, value: unique121}],
      usesTableLine: false,
      withKeySimple: {"name": unique121}});
    if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
      abap.statements.readTable(this.#mt_branches,{keyName: "name_key",
        withTableKey: true,
        into: rs_branch,
        withKey: (i) => {return abap.compare.eq(i.name, iv_branch_name);},
        withKeyValue: [{key: (i) => {return i.name}, value: iv_branch_name}],
        usesTableLine: false,
        withKeySimple: {"name": iv_branch_name}});
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`${abap.templateFormatting((await abap.Classes['ZCL_ABAPGIT_GIT_BRANCH_UTILS'].get_description({iv_branch_name: iv_branch_name})))} not found`)});
      }
    }
    return rs_branch;
  }
  async zif_abapgit_git_branch_list$get_all() {
    let rt_branches = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"name_key","type":"SORTED","isUnique":false,"keyFields":["NAME"]}]}, "zif_abapgit_git_definitions=>ty_git_branch_list_tt");
    rt_branches.set(this.#mt_branches);
    return rt_branches;
  }
  async zif_abapgit_git_branch_list$get_branches_only() {
    let rt_branches = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"name_key","type":"SORTED","isUnique":false,"keyFields":["NAME"]}]}, "zif_abapgit_git_definitions=>ty_git_branch_list_tt");
    let fs_ls_branch_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}));
    for await (const unique122 of abap.statements.loop(this.#mt_branches)) {
      fs_ls_branch_.assign(unique122);
      if (abap.compare.eq(fs_ls_branch_.get().type, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch_type.get().branch)) {
        abap.statements.append({source: fs_ls_branch_, target: rt_branches});
      }
    }
    return rt_branches;
  }
  async zif_abapgit_git_branch_list$get_head_symref() {
    let rv_head_symref = new abap.types.String({qualifiedName: "STRING"});
    rv_head_symref.set(this.#mv_head_symref);
    return rv_head_symref;
  }
  async zif_abapgit_git_branch_list$get_tags_only() {
    let rt_tags = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"name_key","type":"SORTED","isUnique":false,"keyFields":["NAME"]}]}, "zif_abapgit_git_definitions=>ty_git_branch_list_tt");
    let fs_ls_branch_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}));
    for await (const unique123 of abap.statements.loop(this.#mt_branches,{where: async (I) => {return abap.compare.eq(I.type, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch_type.get().lightweight_tag) || abap.compare.eq(I.type, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch_type.get().annotated_tag);},topEquals: {"type": abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch_type.get().annotated_tag}})) {
      fs_ls_branch_.assign(unique123);
      abap.statements.append({source: fs_ls_branch_, target: rt_tags});
    }
    return rt_tags;
  }
  async parse_branch_list(INPUT) {
    return zcl_abapgit_git_branch_list.parse_branch_list(INPUT);
  }
  static async parse_branch_list(INPUT) {
    let iv_data = INPUT?.iv_data;
    if (iv_data?.getQualifiedName === undefined || iv_data.getQualifiedName() !== "STRING") { iv_data = undefined; }
    if (iv_data === undefined) { iv_data = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_data); }
    let et_list = INPUT?.et_list || abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"name_key","type":"SORTED","isUnique":false,"keyFields":["NAME"]}]}, "zif_abapgit_git_definitions=>ty_git_branch_list_tt");
    let ev_head_symref = INPUT?.ev_head_symref || new abap.types.String({qualifiedName: "STRING"});
    let lt_result = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    let lv_hash = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});
    let lv_name = new abap.types.String({qualifiedName: "STRING"});
    let lv_head_params = new abap.types.String({qualifiedName: "STRING"});
    let lv_char = new abap.types.Character(1, {});
    let lv_data = new abap.types.String({qualifiedName: "STRING"});
    let lv_current_row_index = new abap.types.Integer({qualifiedName: "I"});
    let fs_ls_branch_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}));
    et_list.clear();
    ev_head_symref.clear();
    lv_data.set((await this.skip_first_pkt({iv_data: iv_data})));
    abap.statements.split({source: lv_data, at: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline, table: lt_result});
    for await (const unique124 of abap.statements.loop(lt_result)) {
      lv_data.set(unique124);
      lv_current_row_index.set(abap.builtin.sy.get().tabix);
      if (abap.compare.eq(abap.builtin.sy.get().tabix, abap.IntegerFactory.get(1)) && abap.compare.gt(abap.builtin.strlen({val: lv_data}), abap.IntegerFactory.get(12)) && abap.compare.eq(lv_data.getOffset({length: 4}), abap.CharacterFactory.get(4, '0000')) && abap.compare.eq(lv_data.getOffset({offset: 8, length: 3}), abap.CharacterFactory.get(3, 'ERR'))) {
        lv_name.set(lv_data.getOffset({offset: 8}));
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: lv_name});
      } else if (abap.compare.eq(abap.builtin.sy.get().tabix, abap.IntegerFactory.get(1)) && abap.compare.gt(abap.builtin.strlen({val: lv_data}), abap.IntegerFactory.get(49))) {
        lv_hash.set(lv_data.getOffset({offset: 8}));
        lv_name.set(lv_data.getOffset({offset: 49}));
        lv_char.set((await abap.Classes['ZCL_ABAPGIT_GIT_UTILS'].get_null()));
        abap.statements.split({source: lv_name, at: lv_char, targets: [lv_name,lv_head_params]});
        ev_head_symref.set((await this.parse_head_params({iv_data: lv_head_params})));
        if (abap.compare.initial(ev_head_symref) && abap.compare.cs(lv_name, abap.CharacterFactory.get(11, 'refs/heads/'))) {
          ev_head_symref.set(lv_name);
        }
      } else if (abap.compare.gt(abap.builtin.sy.get().tabix, abap.IntegerFactory.get(1)) && abap.compare.gt(abap.builtin.strlen({val: lv_data}), abap.IntegerFactory.get(45))) {
        lv_hash.set(lv_data.getOffset({offset: 4}));
        lv_name.set(lv_data.getOffset({offset: 45}));
      } else if (abap.compare.eq(abap.builtin.sy.get().tabix, abap.IntegerFactory.get(1)) && abap.compare.eq(abap.builtin.strlen({val: lv_data}), abap.IntegerFactory.get(8)) && abap.compare.eq(lv_data.getOffset({length: 8}), abap.CharacterFactory.get(8, '00000000'))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(50, 'No branches, create branch manually by adding file')});
      } else {
        continue;
      }
      abap.statements.assert(abap.compare.initial(lv_name) === false);
      fs_ls_branch_.assign(et_list.appendInitial());
      fs_ls_branch_.get().sha1.set(lv_hash);
      fs_ls_branch_.get().name.set(lv_name);
      fs_ls_branch_.get().display_name.set((await abap.Classes['ZCL_ABAPGIT_GIT_BRANCH_UTILS'].get_display_name({iv_branch_name: lv_name})));
      fs_ls_branch_.get().type.set((await abap.Classes['ZCL_ABAPGIT_GIT_BRANCH_UTILS'].get_type({iv_branch_name: lv_name, it_result: lt_result, iv_current_row_index: lv_current_row_index})));
      if (abap.compare.eq(fs_ls_branch_.get().name, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_head_name) || abap.compare.eq(fs_ls_branch_.get().name, ev_head_symref)) {
        fs_ls_branch_.get().is_head.set(abap.builtin.abap_true);
      }
    }
  }
  async parse_head_params(INPUT) {
    return zcl_abapgit_git_branch_list.parse_head_params(INPUT);
  }
  static async parse_head_params(INPUT) {
    let rv_head_symref = new abap.types.String({qualifiedName: "STRING"});
    let iv_data = INPUT?.iv_data;
    if (iv_data?.getQualifiedName === undefined || iv_data.getQualifiedName() !== "STRING") { iv_data = undefined; }
    if (iv_data === undefined) { iv_data = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_data); }
    let ls_match = new abap.types.Structure({
    "line": new abap.types.Integer({qualifiedName: "I"}),
    "offset": new abap.types.Integer({qualifiedName: "I"}),
    "length": new abap.types.Integer({qualifiedName: "I"}),
    "submatches": abap.types.TableFactory.construct(new abap.types.Structure({
    "offset": new abap.types.Integer({qualifiedName: "I"}),
    "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {});
    let ls_submatch = new abap.types.Structure({
    "offset": new abap.types.Integer({qualifiedName: "I"}),
    "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {});
    abap.statements.find(iv_data, {regex: abap.CharacterFactory.get(22, '\\ssymref=HEAD:([^\\s]+)'), first: true, results: ls_match});
    abap.statements.readTable(ls_match.get().submatches,{index: abap.IntegerFactory.get(1),
      into: ls_submatch});
    if (abap.compare.initial(abap.builtin.sy.get().subrc)) {
      rv_head_symref.set(iv_data.getOffset({offset: ls_submatch.get().offset, length: ls_submatch.get().length}));
    }
    return rv_head_symref;
  }
  async skip_first_pkt(INPUT) {
    return zcl_abapgit_git_branch_list.skip_first_pkt(INPUT);
  }
  static async skip_first_pkt(INPUT) {
    let rv_data = new abap.types.String({qualifiedName: "STRING"});
    let iv_data = INPUT?.iv_data;
    if (iv_data?.getQualifiedName === undefined || iv_data.getQualifiedName() !== "STRING") { iv_data = undefined; }
    if (iv_data === undefined) { iv_data = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_data); }
    let lv_hex = new abap.types.Hex();
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    abap.statements.assert(abap.compare.eq(iv_data.getOffset({length: 2}), abap.CharacterFactory.get(2, '00')));
    lv_hex.set(abap.builtin.to_upper({val: iv_data.getOffset({offset: 2, length: 2})}));
    lv_length.set(lv_hex);
    rv_data.set(iv_data.getOffset({offset: lv_length}));
    return rv_data;
  }
}
abap.Classes['ZCL_ABAPGIT_GIT_BRANCH_LIST'] = zcl_abapgit_git_branch_list;
export {zcl_abapgit_git_branch_list};