{#snippet branchRows(rows: BranchRow[])} {#each rows as row (row.id)} {#if row.kind === "folder"} {@const open = isBranchFolderOpen(row.id)} {:else} {@const tracking = trackingFor(row.branch)}
checkoutOnDoubleClick(event, row.branch)} oncontextmenu={(event) => openBranchContextMenu(event, row.branch)} title={branchTitle(row.branch)} > {#each highlightParts(row.displayName) as part, index (index)} {#if part.match}{part.text}{:else}{part.text}{/if} {/each} {#if tracking.kind === "tracked"} {:else if tracking.kind === "gone"} {:else if tracking.kind === "local"} {:else if tracking.kind === "remote-tracked"} {/if} {#if row.branch.current} HEAD {/if}
{/if} {/each} {/snippet}
{branches.length}
{#if collapsed} {:else if !hasRepository}

{t("branches.openRepo")}

{:else}
{#if createOpen}
{#if showLocal} {#if localBranches.length === 0}
{t("branches.emptyLocal")}
{:else} {@render branchRows(localBranchRows)} {/if} {/if}
{#if showRemote} {#if remoteBranches.length === 0}
{t("branches.emptyRemote")}
{:else} {@render branchRows(remoteBranchRows)} {/if} {/if}
{#if filtering && visibleLocal.length === 0 && visibleRemote.length === 0}
{t("branches.noMatch", { query: filterText.trim() })}
{/if}
{/if} {#if contextBranch} {/if} {#if contextFolder} {/if}